I need to be able to schedule a task from a batch file that I run using SchTasks. BUT . . . heheh . . . I need the task to run on startup - once, and then delete itself.
The task will be set to run on Server 2003 and Server 2008R2 machines. The command line switch for a task to delete itself doesn't work on "startup" tasks because they run at every startup, not just one time. What I think I need is a "run once" task that is set to run 10 minutes after the task is created.
Here's how it would work:
Script does a bunch of things
Script creates task for 10 minutes from now
Server is rebooted
Server comes back online
Task executes
Can it be done? How do I do it? I've experimented a little with trying to set a variable equal to time +10, thinking that I could specify the variable in the schtasks time parameter but I can't figure out how to add 10 to "time" . . . Any ideas?
Thanks for the help,
MJ