ms dos - delete command

Dell / GX520
January 15, 2009 at 17:32:29
Specs: Windows XP, Intell

I need to delete all the files more than 90 days old using msdos command script . What parameters do I use with "delete" command?


See More: ms dos - delete command

Report •

January 15, 2009 at 23:33:02
XP has no MS-DOS, therefore you need to use CMD.EXE NT COMMAND PROMPT commands:

Report •

January 16, 2009 at 06:08:03
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 & "	" &
	end if

when 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.

Report •

Related Solutions

Ask Question