Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I need to delete all the files more than 90 days old using msdos command script . What parameters do I use with "delete" command?
Thanks

here is solution using vbs/wscript/cscript/wsh/wsf, okay, i am not really sure about what's it called. it looks like vb to me.
this is my first attempt, so i am not responsible for any damage done.to run, type: cscript datediff.vbs
or just datediff'datediff.vbs - delete files 90days old (last modified) Set fs = CreateObject("Scripting.FileSystemObject") for each f in fs.getfolder(".").Files if Datediff("d",date,f.DateLastModified) < -90 then wscript.echo f.DateLastModified & " " & f.name 'f.delete end if nextwhen you are sure it displays the correct file(s), remove the comment on line f.delete
for the cmd.exe script, it involves date math. i think someone will eventually come up with a solution.

![]() |
![]() |
![]() |

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