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

后端 未结 13 2511
忘掉有多难
忘掉有多难 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:15

    Solved this same issue. Script would fail when connecting to database then after fixing that it failed when creating Xls file. I created a bat file and added the below contents to it. this bat file will call my vb script and run it in 32 bit mode.

    %windir%\SysWoW64\cmd.exe /C "c:\windows\system32\cscript.exe //B //nologo C:\ScheduledJobs\PrimeReconDev\myVBScript.vbs"
    

    I set up the task schedule to execute my the bat file with the above contents and sect the executing user to Administrators. Do this by sing the "change user or group" option on the general tab. once done I was able to execute successfully no issues. i was initially executing as me and I am in the administrators group but it was still failing. Executing as built in administrators did the trick

提交回复
热议问题