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 - deletes folders & more
Name: jds123 Date: January 29, 2004 at 08:21:01 Pacific OS: w2000 CPU/Ram: 256meg
Comment:
Hi there I'm having trouble accomplishing the below.
I would like a batch file that will delete sub directories and the files contained in them, but it should keep the latest 10 sub directories. example- c:\test\ contained in this directory are sub directories named jan012004, jan022004...jan102004.
In the event of a new dir being added to c:test\ ie - jan112004, jan012004 should be deleted by the batch program. However if no new sub directory is added ie jan112004 the oldest sub directory should not be deleted by the batch program ie jan012004.
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: I have a batch file that is in an unknown folder and needs to be deleted when it stops running. Any idea? I only Batch if possible, 2000 more lines of code, oh well....