Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a scheduled task that I am going to deploy through a script.
The task needs to be interactive with the users desktop, so I think I need to use AT.
I also want to be able to remove the task from the computers when something in the task needs to be updated or if the task is no longer needed.
I do not want to delete all the other scheduled tasks when I do this, so I want my script to have a specific ID number that I can delete at a later date. I have checked the documentation for the AT command, but I cannot find documentation on how to create a scheduled task with a specific ID. (

Is there a way to create a scheduled task with a specific ID, or am is there a better way to achieve my goals?

Clients are Windows-XP Scheduled task runs a small executable. All clients are part of a domain, and I have domain admin rights.

share|improve this question
up vote 1 down vote accepted

Aco\cording to the documentation, you cannot create a specific task ID (just like you cannot create a specific PId for a process), but you can find the task ID of a task when it's running (by typing 'at' at a command-line) and then delete it.

You can also get/delete scheduled task ID programatically using WMI objects (take a look at this link).

share|improve this answer
Not the answer I was hoping for, but it answers my question. I looked at the link, but I do not see how I can identify which scheduled task is mine through that code. Do you know how I can do that? Keep in mind we could be deploying several tasks with AT, and I want to make sure I only remove my scheduled task, not all of them. Or, am I asking too much? – Adam Towne Aug 18 '09 at 12:50
While I can't give you the specific line here, using WMI is akin to using SQL - it will allow you to find the task ID by providing the task name. Assuming each one of your tasks has a unique name, you can locate their IDs. – Traveling Tech Guy Aug 19 '09 at 7:33

While you can't specify the ID that is used with the AT command, you can use this script to identify the ID that your AT scheduled task is using so you can delete it from a batch file:

Set sCommand=ScheduledCommand.cmd

findstr /I %sCommand% AT.txt>nul
If %ErrorLevel%==1 Goto CONTINUE
FOR /F %%i IN ('findstr /I %sCommand% AT.txt') DO (set ID=%%i)
AT %ID% /D

DEL AT.txt>nul

Usage: Simply set sCommand to the name of the command that you have scheduled that you want to remove.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.