A script/batch to kill a batch file from scheduled tasks?

  • Thread starter Thread starter Bogdan
  • Start date Start date
B

Bogdan

I'd like to kill a batch (cmd) file from a scheduled task (i.e. Control
Panel.Scheduled Tasks). Is there a command/utility that can do that?

Thanks,
Bogdan
 
Schedule a new task to run,, and enter (or browse) for a command : "cmd.exe"

Choose a date and time to run the command and click [next]

Then check-mark the box "Open advanced properties for this task when finished"

In the advanced properties for the task - add the following text after the "cmd.exe"
:

/d /c del /f /q c:\windows\mybatch.cmd

....so the command looks like this in the "Run:" box in the task's properties :


C:\WINDOWS\system32\cmd.exe /d /c del /f /q c:\windows\mybatch.cmd


(obviously, editing the name of your batch [cmd] file name for 'mybatch.cmd' )


OR....

In the "Group Policy Editor" (found on the 'Start Menu' under 'Administrative
Tools' ) navigate to :

Computer Configuration\
Windows Settings\

Then under the "Scripts (Startup/Shutdown)" item, press on the "Add" button and point
the browser at a batch file that you have pre-written with the same (above)
command-line in. i.e.

@echo off
del /f /q c:\windows\mybatch.cmd


....in the batch file. This command will then run at every boot - deleting your batch
[cmd] file.


==

Cheers, Tim Meddick, Peckham, London. :-)
 
Back
Top