Task scheduler cannot open batch file when set to run whether user is logged on or not

前端 未结 7 1806
小蘑菇
小蘑菇 2020-12-24 07:46

OS: Windows Server 2008 R2 Enterprise

I am unable to get the Task Scheduler to run .bat files while I am logged off. I have a a production .bat file I want to use, b

7条回答
  •  一个人的身影
    2020-12-24 07:58

    I have resolved this problem with help from a contractor who was doing some other work for my institution.

    In the properties window for the task, on the Action tab, when creating or editing the action that opens the batch file (in my case test.bat), there is the "Program/script:" field and there is also a "Start in (optional):" field. I previously had the "Program/script:" field containing the full path to the file, ending with the file name, and I had the "Start in (optional):" field null. This configuration appears to work without issue when the task is set to "Run only when user is logged on" in the General tab of the task's properties window. However, this configuration does not work when the task is set to "Run whether user is logged on or not".

    In order to resolve the problem, I changed the action so that the "Program/script:" field contained only the file name, not the file path. I put the file path in the "Start in (optional):" field. This configuration works when the task is set to "Run only when user is logged on"! I have tested with the task running on a trigger and also with running it manually.

提交回复
热议问题