Tag Archives: Task Scheduler

Batch file running on command prompt but not in Microsoft window scheduler

Batch file running on command prompt but not in Microsoft window scheduler

Microsoft Scheduler not run the Scheduled task .bat file but working fine manually run.

I am created a job for rman backup scheduled and created bat file to execute it in Microsoft windows Scheduler. On running the .bat file manually it’s running successfully.
But when I scheduled it with windows scheduler its not running actually finished in 1 seconds as shown in windows scheduler history.

Followings all the steps I performed to solve my problem. I would guess that maybe some of these face same problem.

Solution:

1) Open the Task Scheduler of Microsoft Windows.
2) On General Tab, make sure the task is set to “configure for Windows Vista or Windows 2008” on the first page of the task properties.
3) On Action Tab, Open the Task Properties by click on “edit” Button at bottom, need to set the “start in” field with the folder location where the batch file located.
In the “Edit Action” Window there is a field for “start in (optional)” that you set to the path to the batch file.
Example:
D:\scripts\rman.bat is the my file for rman backup , then set “Start in (optional)” with D:\scripts value.
4) Make sure that the task is running as an account that has explicit “Full access” permissions to all these things: The .bat file itself, the folder containing the .bat file, and the target files/folders that are affected by the .bat script. Inherited permissions didn’t seem to work for me.
5) Make sure that the account running the task is a member of the local “administrators” group for this machine.
5) Make sure that the task is set to “run whether logged on or not”
6) The Task should run successfully with expected output when you right-click on the task and select “run”
If it does that then it will run successfully when you are logged off.

Advertisements