General discussion

Locked

creating schedule tasks

By choy.waigiat ·
Can anyone teach me how to create a schedule task that runs on a scheduled time and day which allows me to delete unwanted files from a folder.

thanks and regards,

This conversation is currently closed to new comments.

9 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by Skitzizzy In reply to creating schedule tasks

First you will need to write up a batch file to delete the files in the directory you want. Save the batch file to a convenient location, probably in the folder you wish to clean.

Then go to your control panel, select Schedule Tasks and set up the task scheduler to run the batch file at a specified time.

Collapse -

by choy.waigiat In reply to

Can you tell me what are the commands to type to create the batch file. Show me an example.

Collapse -

by Skitzizzy In reply to creating schedule tasks

Open notepad and type something along the lines of:

REM This script deletes files from C:\test
cd \
cd test
del testfile.txt
pause

Save the file as filename.BAT or filename.CMD. If you want to delete all files of a particular extension type, use del *.txt

If you want to delete all the files, use del *.*

Hope that helps you

Collapse -

by choy.waigiat In reply to

this script works. But it will prompt me to answer Yes or No to delete the files. Is it possible that the script do it automatically without me pressing Y to delete and after it has finished the tasks, the box will close by itself.

Collapse -

by Skitzizzy In reply to creating schedule tasks

You can query what switches an executable uses by opening the a command line and typing filename /?. In this instance, use del /?

But as you ask, to do it in quiet mode, use the /q switch...ie:

del *.txt /Q

I thought del will only prompt if you use the /p switch as well? Oh well.

Collapse -

by choy.waigiat In reply to

Won't work.

Collapse -

by Skitzizzy In reply to creating schedule tasks

Try downloading Windows Script host and reading the help me files from there then.

Collapse -

by choy.waigiat In reply to

Poster rated this answer.

Collapse -

by choy.waigiat In reply to creating schedule tasks

This question was closed by the author

Back to Windows Forum
9 total posts (Page 1 of 1)  

Related Discussions

Related Forums