Computing.Net > Forums > Programming > Batch File delete function

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.

Batch File delete function

Reply to Message Icon

Name: Mod Squad
Date: November 19, 2004 at 11:52:04 Pacific
OS: win XP
CPU/Ram: P4 512 MB
Comment:

I am having a bit of trouble keeping a directory clear of extraneous files, here is the situation.
In directory X I have folders A,B and C and they contain files. Throughout the day people save additional files at the root (X) rather then inside the folders. Is there a way I can delete the files but not touch the folders using a batch file?

thanks



Sponsored Link
Ads by Google

Response Number 1
Name: borelli35
Date: November 19, 2004 at 13:26:50 Pacific
Reply:

=====================================================================
Very simple. Just use this batch code. Note that directory X is referenced as you have above so use whatever is appropriate in place of X:

echo off
rem the next line deletes only files and NOT directories.
del C:\X\*.*

borelli35


0

Response Number 2
Name: Mod Squad
Date: November 19, 2004 at 13:40:21 Pacific
Reply:

ah crap,

thanks. I tested that without putting a folder in my test location.

*idiot=me

I appreciate the 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 Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch File delete function

Batch File deleting files by date? www.computing.net/answers/programming/batch-file-deleting-files-by-date/15581.html

Batch file delete file by file name www.computing.net/answers/programming/batch-file-delete-file-by-file-name/16849.html

Batch File Delete Temp www.computing.net/answers/programming/batch-file-delete-temp/17530.html