Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi there, this is probably and easy one, but does anyone know the DOS command for deleting files by date....?????

No, this isn't an 'easy one', since there is no command that can do it directly -- a work-around is required.
The XCOPY.exe command has the /D (/D:date) switch, which copies only files modifyed on or after the date specified. Example:
xcopy *.jpg .\TEMPFOLD /d:05/01/02
You can copy the files which you DON'T want to del to a temporary folder, than delete all files and recover the files which shouldn't be deleted.
This idea will give a very useful batch file. I'll develop it and post it soon here.
Stand by. Meanwhile, you can do it manually.
-- Leonardo Pignataro - Secret_Doom --
secret_doom@hotmail.com
www.batch.hpg.com.br

Hi K
Secret Doom is right by saying it's not an easy one, I'm not sure how it could be done in a batch file but I could try writing one using the C programming language and email it to you. Do you want to delete a specific date or delete files with dates less or greater than a specific date or all three.
let me know.

![]() |
Boot directly into Dos
|
upgrading dos
|

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