I have a program that creates the batch files then uses SchTasks to submit them. The tasks are basically a robocopy job moving files from one server to the next.
We use the command line as follows:
schtasks.exe /create /ru %sUser% /rp %sPass% /sc ONCE /st %sSTime% /sd "%sMonth%/%sDay%/%sYear%" /tn "%sReplName%" /tr "%sCWDir%%sBatDir%\%sReplName%.bat" /F /Z /V1
Basically we put it in as a admin user, to run in 2-3 minutes from now, and I want it to delete the task when completed. Simple right? All of the parameters are good, our Windows Server 2003 boxes use the same command line minus the "/V1" switch.
Problem is, on Windows Server 2008 the tasks get created then start to run and disappear... if I remove the "/Z" switch then it runs as expected, but does not delete the task at end of the job, and I want it to delete on completion. We do
not have the problem on Windows Server 2003.
Some of the tasks actually start and run and we can see the batch file and robocopy running on the server, but no task.
Ideas anyone?