locked
Server 2008 SchTasks deletes tasks too fast with /Z switch RRS feed

  • Question

  • 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?

    Tuesday, October 19, 2010 10:17 PM

All replies

  • I realise this is an old thread but I'm having the same issue, at least I think it is as I don't even notice the tasks being created. If I remove /z from the schtasks command the job gets created.

    Did you find a solution?

    Wednesday, January 26, 2011 6:52 PM