Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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. (http://support.microsoft.com/kb/313565)

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

1 Answer 1

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

Your Answer

 
discard

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.