|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|||
|
Hi, this may have been covered however I cant seem to find what im looking for.
At present I have: Code:
@echo off rem .:------------------------------------------ rem .: Deleting contents of scans rem .:------------------------------------------ del "G:\Scans\*.*" This works well for deleting all the files withing the Scans folder. I want to adapt this now so it deletes only the files that are 1 week old. How would I change the code to achieve this? Thanks in advance jmcall10 |
|
||||
|
I would recommend getting the FORFILES.EXE from the Resource Kit tools released from Microsoft, then you can just do this:
FORFILES -pc:\foldername -s -m*.* -d-30 -c"CMD /C del @FILE" -p = path -s = include subdirs -m = match filetype -d = age in days (can also be set as an absolute date ie DDMMYYYY) -c = command to execute Note there are no spaces between the switches and their arguments. http://www.dynawell.com/support/ResKit/winnt.asp |
|
|||
|
Hmm, this is on a work computer so wont be able to install anything
![]() Is there another way that I can do this? thanks for your response ![]() |
|
|||
|
ive never touched vb scrpiting.
How would I code the same thing in vbscript? Thanks in advance jmcall10 |
![]() |
| Viewing: Dev Hardware Forums > SOFTWARE > Programming > DOS Batch - Deleting files older than a week |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|