![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Cannot create run-once task with schtasks I am trying to create a task that runs once and then gets deleted. According to (my interpretation of) the schtasks /? information, this should work: schtasks /create /sc once /tn OneSync /tr C:\bat\sync.bat /st 10:58 /F /Z This should run c:\bat\sync.bat at 10:58am today (assuming it's before 10:58am now), and then delete the task (/Z). However, I get this message: ERROR: The task XML is missing a required element or attribute. If I take the /Z away, the task is created as expected and runs at the right time, but does not get deleted afterwards. I am running (64-bit) Vista. Is this a bug, or am I missing something? If I do the same thing on XP (without /F and /Z) the task is created, runs at the right time, and then vanishes, which is exactly what I want. |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Cannot create run-once task with schtasks Using the /V1 switch seemed to work here - notepad ran and then the task was deleted- although I had to enter the password manually in this case. You may be able to tweak it further. schtasks /create /sc once /tn Notepad /tr C:\Windows\System32\notepad.exe /st 19:02 /F /Z /V1 -- Jon "Graeme Perrow" <GraemePerrow@xxxxxx> wrote in message news:7F2FEA13-07F1-445E-857A-73D40493D2FF@xxxxxx Quote: >I am trying to create a task that runs once and then gets deleted. >According > to (my interpretation of) the schtasks /? information, this should work: > > schtasks /create /sc once /tn OneSync /tr C:\bat\sync.bat /st 10:58 /F /Z > > This should run c:\bat\sync.bat at 10:58am today (assuming it's before > 10:58am now), and then delete the task (/Z). However, I get this message: > > ERROR: The task XML is missing a required element or attribute. > > If I take the /Z away, the task is created as expected and runs at the > right > time, but does not get deleted afterwards. > > I am running (64-bit) Vista. Is this a bug, or am I missing something? If > I > do the same thing on XP (without /F and /Z) the task is created, runs at > the > right time, and then vanishes, which is exactly what I want. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Task Scheduler - command <schtasks /query /fo csv /nh> does not wo | Vista General | |||
| Unable to use Schtasks command to schedule task for users group | Vista General | |||
| Can't display or change a task with schtasks.exe | Vista account administration | |||
| schtasks Does Not Run It When The Path of the Task Contains a Spac | Vista General | |||
| Creating a Schedule Task in Vista with schtasks, Getting Access De | Vista General | |||