Today I like talk about Schtasks command on Windows, it is a classical tool use since many time.
Creating a new task
C:\oracle\oradb\admin>schtasks /create /tn “Xwin purge” /tr “C:\oracle\oradb\bin\sqlplus xxx/yyy @C:\oracle\oradb\admin\purge.sql” /sc daily /st 14:10 /ed 04/02/2017
The task will be created under current logged-on user name (“MEDIATV\dbadmin”).
Please enter the run as password for MEDIATV\dbadmin: *******
WARNING: The scheduled task “Xwin purge” has been created, but may not run b
ecause the account information could not be set.
Displaying scheduled tasks
INFO: There are no scheduled tasks present in the system.
Deleting a scheduled task
C:\oracle\oradb\admin>schtasks /delete /TN “Xwin purge”
WARNING: Are you sure you want to remove the task “Xwin purge” (Y/N )? y
SUCCESS: The scheduled task “Xwin purge” was successfully deleted.
Running now the task
C:\oracle\oradb\admin>schtasks /run -tn “Xwin purge”
SUCCESS: Attempted to run the scheduled task “Xwin purge”.
HTH – Antonio NAVARRO