Windows 2008 server task scheduler does not run .b

2019-02-01 01:10发布

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 supposed to process.

Any ideas on how to fix this issue is most welcome

4条回答
劳资没心,怎么记你
2楼-- · 2019-02-01 01:36

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

查看更多
唯我独甜
3楼-- · 2019-02-01 01:45

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.

查看更多
闹够了就滚
4楼-- · 2019-02-01 01:45

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.

查看更多
劫难
5楼-- · 2019-02-01 01:49

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?

查看更多
登录 后发表回答