ProblemYou want to delete a scheduled task. SolutionUsing a graphical user interface
Using a command-line interfaceYou can use the schtasks.exe command to delete a task. The following command deletes the task named Job1: > schtasks /delete /tn Job1 Using Group PolicyYou can't delete a task with Group Policy, but you can prevent it from being deleted. Here is where you can find that setting: \Computer Configuration\ Administrative Templates\Windows Components\Task Scheduler \User Configuration\ Administrative Templates\Windows Components\Task Scheduler Prohibit Task Deletion Using VBScript' This code deletes a scheduled AT task. ' ------ SCRIPT CONFIGURATION ------ intJobID = <JID> ' e.g. 1452 strComputer = "<HostName>" ' e.g. dns01 ' ------ END CONFIGURATION --------- set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set objInstance = objWMI.Get("Win32_ScheduledJob.JobFailure deleting task id: " & intJobID else Wscript.Echo "Sucessfully deleted task id: " & intJobID end if DiscussionUsing a graphical user interfaceYou can't use the applet to delete a task on a remote system. However, there is another option. By default, a Scheduled Tasks share is created on Windows XP, which contains the job files for each scheduled task. Simply browse to \\<HostName>\Scheduled Tasks and you should see the list of scheduled tasks on that system (if you have administrator privileges). From here you can right-click a task and select Delete. Using a command-line interfaceTo delete a task from the command line, you need to know the task name. Unless you know it off the top of your head, you'll need to query the current scheduled tasks to find the name of the one you want to delete. See Recipe 10.13 for more on how to do that. See AlsoRecipe 10.9 for creating a scheduled task; Recipe 10.13 for listing the scheduled tasks; and MS KB 310424, "HOW TO: Work with Scheduled Tasks on Remote Computers in Windows XP" |