Windows Scheduled Startup Task doesn't appear to be fully working but why?

Posted by Devtron on Server Fault See other posts from Server Fault or by Devtron
Published on 2011-03-15T22:58:20Z Indexed on 2011/03/16 0:12 UTC
Read the original article Hit count: 534

I originally tried to use Group Policy to enforce a startup script to run at startup. My startup script is a .CMD file, which calls 10 .exe files. Using Group Policy I could never get this to work....so I looked into using Scheduled Tasks. And here I am.

I have tried two different versions of my script (for syntax purposes). I originally thought my syntax could be bad, so I tried a few approaches. Neither work.

My #1 .CMD file approach commands look similar to this:

start "this is my title" /D "C:\Somepathhere\myExecutable.exe" "..\..\published\wc_task.wfc"

My #2 .CMD file approach commands look similar to this (it invokes a shortcut file):

rundll32 shell32.dll,ShellExec_RunDLL "C:\Somepathhere\bin\Virtual Workflow.lnk"

^ Both of these scripts work fine if I manually run them, either by running the .CMD file, or even by manually forcing the Schedule Task MSC console to "Run" this script. Manual process seems to work fine, but automated it does not.

My scheduled task is set for startup and uses "highest privileges" to execute as Admin.

At the end of my .CMD script, I added a line to write to a text file, just to prove that the script was being run. That command looks like this:

echo foo > C:\foo.txt

When I reboot my server, and Schedule Tasks kicks in, I never get my ten .EXE files to run, but I do get the C:\foo.txt on my drive.

What gives?

© Server Fault or respective owner

Related posts about windows-server-2008

Related posts about scheduled-task