0

I have a vbs script that opens Excel and runs a vba script. It works fine on Windows 7, both when run manually and as a task in Task Scheduler. It works fine when run manually on Server 2008 but when I run it as a scheduled task, it hangs. I added some rudimentary logging to the vbs file and it appears to hang as soon as the vba script is run. Excel is (apparently) opened fine.

I have already:

  • Chosen the correct directory for "Start in"
  • Chosen "Run with highest privileges"
  • Added the "Desktop" folder to C:\Windows\SysWOW64\config\systemprofile
  • Made sure the user that the task is set to run as has full access to all of the files and folders touched by the script.
  • Tried all possible variations of this: Task Scheduler running but not finishing or working properly VBscript
  • Set to "Run whether user is logged in or not"

(note: before adding the desktop folder the task "ran" successfully but didn't actually do anything it was supposed to)

Any ideas?

Community
  • 1
  • 1
ZackG
  • 177
  • 3
  • 3
  • 9
  • Let me guess... you have it set to `Run whether user is logged on or not`? – Bond Jul 17 '15 at 20:17
  • http://blogs.technet.com/b/askperf/archive/2015/02/18/help-my-scheduled-task-does-not-run.aspx – Bond Jul 17 '15 at 20:26
  • Hmm. I've done most of those. I'm already using a .bat as the task which calls the vbs file. There is no "Configure for Windows XP etc." option – ZackG Jul 17 '15 at 21:09
  • If you launch the task thru Task Scheduler while logged in, does it work? – Bond Jul 17 '15 at 21:18
  • No, that's how I'm testing it. I haven't actually had it trigger on its own (with me logged on or not) I just click on the task and choose "Run" – ZackG Jul 17 '15 at 21:32
  • This could be an issue with the Server 2008 Task Scheduler if the Windows 7 Task Scheduler runs the same batch file and VBS without problems. Other suggestions are running the .bat/.cmd file as [administrator or SYSTEM](http://stackoverflow.com/questions/10833177/schedule-task-does-not-work-in-windows-server-2008-r2) and checking the .bat/.cmd file does not include [filenames including quotations](http://stackoverflow.com/questions/5085116/windows-2008-server-task-scheduler-does-not-run-bat-batch-job) I presume that other tasks can be run from a .bat run by the Task Scheduler? – Mousey Jul 20 '15 at 01:24
  • The .bat file does not have any filenames with quotations (or any quotations at all). I'll try running it as SYSTEM, though I'm doubtful. – ZackG Jul 20 '15 at 14:28

0 Answers0