My script won't run under the task scheduler. Why?

后端 未结 13 2354
忘掉有多难
忘掉有多难 2021-02-04 08:53

I have a vbscript script that I runs fine when I am running it myself.

For some reason, when I run it under the task scheduler as an administration user, it runs, but do

相关标签:
13条回答
  • 2021-02-04 09:19

    I've had similar problems in the past with code not executing when scheduling vbs scripts - it can be problematic! Also curious to see if anyone can solve this. (by the way, we solved it by rewriting the code as a C# console application)

    0 讨论(0)
  • 2021-02-04 09:19

    I had the same problem until I added the path where the bat job is stored into the Start in on the action tab.

    Right click Task → Properties → Actions → Edit Start in (optional)

    Just fill in the path to your bat job.

    0 讨论(0)
  • 2021-02-04 09:20

    Alternative Solution:

    Run only when user is logged in

    Make that selection inside of the task manager.


    This is what fixed did it for me (on 3 Separate Computers - Win7 Pro, Win12 Server)

    I hope it can help someone else.

    0 讨论(0)
  • 2021-02-04 09:25

    For Windows 2008 you probably need to ensure that the task runs with administrative privileges.

    General Tab - (Check) Run with highest privileges

    0 讨论(0)
  • 2021-02-04 09:26

    When I've had this problem it's usually because the program running on my task is erroring out, even though the return value of the completed task didn't report any problem.

    You say it runs but doesn't write to your log -- is it possible it's crashing before it writes to your log?

    If you haven't already, add error handling to your script and try to log any errors, or at least try to trace how far through the script it's getting.

    0 讨论(0)
  • 2021-02-04 09:28

    I had real problem with this (well a morning) and found this solution here:

    In the windows task scheduler I had to click "change user or group" button and add "Administrators" group.

    Hope it helps someone.

    0 讨论(0)
提交回复
热议问题