I am trying to get a very simple batch script to run when my Windows 2008 Server (R2) system starts up. I have added the script to the "Startup Scripts" in the local group policy by running gpedit.msc
, and I see the script listed under Windows Settings/Scripts (Startup/Shutdown)/Startup
when I run rsop.msc
, but the script is not being executed. The "Last Executed" column in rsop
is empty even after a reboot, and a file that should be created by the script is never created.
At the moment, the entire contents of the script are:
rem Check if this script is running.
date /t > c:\temp\flag
The target directory (c:\temp
) exists. The script is called c:\scripts\startup.bat
, and works fine if I run it by hand.
psexec
was giving me weird errors, and replacing the script (rename oldname newname, type newname > oldname
) made them go way. After applying SP1, I can't reproduce the problem. MDMarra, if you post your comment re:psexec
as an answer I'll accept that one, since it seemed to provide a useful diagnostic.'