Schedule a Batch file to delete files at particular intervals

Hi,

I need to write a batch file/shell script that runs at specified intervals daily and deletes specified set of files.

Can anyone pls help me with the code.

Thanks,
Indom.

Please read the forum rules. You should perform searches before asking questions (this question having been answered several times). You should also post to the correct forum. This isn't an "advanced" topic.

Cheers,

Keith

Hi,

This is the batch file I have created to delete files.

echo off
rm -rf C:\\DDRIVE\\RD\\newfolder\\temp\\*
echo All The files have been deleted

For every 15 minutes we get the data and it should be deleted at the 13th minute.
can anyone pls tell me how to schedule to every 13th min daily.
Unable to get the syntax right for AT command.

Thanks,
Indom

Sounds like you'll want to set up a cron job. Read through this site and see if it'll work for you:

http://www.webmasters-central.com/t/cron.shtml

the fact your useing a "C:\" drive says you are trying to do this on a windows machine.

you will have to find a schedular for windows. i think win XP comes with one by default.

but reguardless you asked the question in the wrong forum.

Wow, you have a good eye. :slight_smile: I'll move it to the Windows forum.

I'm not sure on the syntax, check your help on the machine your using the at command. Don't know what your running on, but you seemed to be mixing the two OS commands.

try windows "at" command:

Local Machine
at 13:30 cmd /c "del C:\DDRIVE\RD\newfolder\temp\*"

Really need to read the help pages. If its on a remote computer then you need to designate that after "at"

at \\somecomputer 13:30 cmd /c "del c:\DDRIVE\RD\newfolder\temp\*"