开发者

Windows 2008 server task scheduler does not run .bat batch job [closed]

Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 10 years ago.

Improve this question

I have a batch file on a Windows 2008 server that, when invoked from command line works fine. However, when I set a scheduled task to run this job, it does not work properly.

The task scheduler does show that that the task is getting run at regular intervals, it does not show any error. But, the batch file does not process what it is sup开发者_JS百科posed to process.

Any ideas on how to fix this issue is most welcome


Windows Server 2008 will not run any batch file with quotation marks " inside the batch file. See http://technet.microsoft.com/en-us/library/dd851678.aspx


I had a similar problem, my .bat file wouldn't correctly execute when I had the full file path in the "Program/script" field.

"D:\path\to\file\somebat.bat" didn't execute. (with quotes)

When I put D:\path\to\file\ (without quotes) in the Start in (optional): field and somebat.bat in Program/script: field somebat.bat executed correctly.

Go figure... not exactly sure why having "D:\path\to\file\somebat.bat" in the Program/script: won't work.

Maybe someone could shed some light on that?


In my case, I had 'Run whether user is logged on or not'. When I changed to 'Run only when user is logged on' it worked OK.


Make sure the task is running under an account with the necessary privileges. When you run a batch script from the command-line directly, it is running under your user account, which may have different permissions than the default account used for scheduled tasks.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜