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
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?
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.
Summary: Relates to an ealier post with title: Batch File deleting files by date? HAD TO CHANGE FOLLOWING TO GET WORKING 1. In Line: for /f "tokens=2" %%i in ('date /t') do set thedate=%%i Change tokens=2 to t...
Summary: Hello Everyone, Recently I've been working on a multifunctional batch file that will make deleting, reformatting, cleaning, transferring, and locating files quickly. Anyways one of my function ...