Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Schedule Tasks!

Status
Not open for further replies.

WastinAway

Technical User
Jun 21, 2004
31
0
0
US
In windows can you write a script in schedule tasks to let's say delete a file at a certain time. Or is it just for programs in that list? thanks
 
One way to approach this would be to setup a batch file that will delete the file you want then you could use task scheduler to run the batch file at the time you want. Also, you can use the browse button when setting up a new scheduled task to browse for and run anything you want.
 
How do you go about creating a batch file?
 
Say the file you want to delete is called TEST.TXT and lives on 'C' drive. A simple batch file to delete this would be as follows:

del c:\test.txt

You can add various 'switches' to customise EG you can make it ask for confirmation before deleting by adding /P after the above. To write the batch file use Notepad. After you've entered in all your text, save the file as EG TEST.BAT not a text(txt) file, or you could save it as a text file then rename it to a BAT file later. There are also commands to delete whole directories but I wont go into that. Take a look at this site. It's a good introduction and gives you lots of examples.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top