There is a batch file which is scheduled to run at 11PM everynight. And we saw some issues with it, so trying to simulate the behaviour. For which i changed the Windows Server 2012 timing to onedayback at 10:59PM and wait for batch file to run by scheduler. But nothing happens.

Please suggest how can i simulate.


If you want to run the task, simply right click on the task in task scheduler and click 'Run'.

  • If i run directly things work fine. But if i leave to scheduler then it seems that the scheduler runs batch file with different parameters. So to debug this i want to run the batch by scheduler... – s.s Oct 10 '13 at 7:49
  • 1
    @s.s Oh I see, in that case try scheduling the task to happen sooner (E.g. at a specific time, and make that time 2 minutes from now). It's probably not running when you turn back the clock because the current time is 'before' the last time it ran. – blacklight Oct 10 '13 at 9:32
  • Running the batch file directly from Explorer or a command line can certainly cause it to run differently than from Scheduled Tasks. But right-clicking on the job in Scheduled Tasks and running should cause it to run the same as if triggered by the clock. – Jonathan J Oct 10 '13 at 19:46
  • Ditto Jonathan J. Are you able to post the batch file here, or expand on what you mean by "saw some issues with it"? – Simon Catlin Oct 10 '13 at 20:06
  • Batch file runs an exe . I updated config file of exe with new start and end dates. Now when I run by right click on scheduler or run exe directly I see everything works as expected. But if I leave batch file to run by scheduler, it seems like exe ran with older dates. I was trying to simulate this behavior by going back on time setting .... – s.s Oct 13 '13 at 7:35

Change the time at which the task triggers for testing. Changing the time on your server itself can cause more issues than it fixes. Specifically, it'll cause trust issues in your domain (if you're using a domain) and any clients depending on the server will experience issues accessing it as their time will not match.

Also, have you checked to see what other tasks or processes may be running on your server at the time it is normally scheduled to execute?

  • Agree with you its risky to change timing settings on server. But the one I am using is dedicated to testing.... – s.s Oct 13 '13 at 7:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.