Delete files using Batch. (Full Version)

All Forums >> [Web Development] >> Server Issues



Message


earthangelghost -> Delete files using Batch. (8/18/2008 9:40:38)

First a little background. I have never touched batch files in my entire life. I have done a bit of HTML and C++ but I have forgotten most as I've not touched it much in the past 8 years.
I'm working for a company and my boss has said if I can make a batch file to delete all but the last 7days of files within a directory then I he buys dinner on Monday.

Problem is I have looked at batch files and realised without a bit of help I have no idea where to start. I normally look at code logically and then trial and error, this isn't going to happen with what i've seen within this week.

So can someone give me some pointers on how to get a simple batch file like this working. From what I can figure I need it to find the folder, check the date and compair to system date, then delete anything over 7 days. Now I just need a help to get the code for this.

Help appreciated in advance.




treetopsranch -> RE: Delete files using Batch. (8/18/2008 12:52:48)

Look here: http://forums.devshed.com/windows-help-34/deleting-files-older-than-14-days-using-batch-file-script-364137.html

and:

http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/Q_22162047.html
(Bottom of page)

Google it. You will find some other ways to do it. Some with .bat files some with other scripting languages.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.0625