I'm trying to use forfiles logic to echo the content that meets the specified criteria which I want to leverage in a logfile. I then want to have a second forfiles setup to actually delete that content. However, the first forfiles seems to be changing the date modified. Is there a way to get around that?
Code: Select all
FOR /F "tokens=*" %%a IN (
'FORFILES /P "!STRING!" /S /D -!AGE! /C "cmd /c IF @ISDIR == TRUE ECHO @path"^
2^>^&1 ^| FINDSTR /I ERROR'
) DO SET "CMDRSLTECHO=%%a"
Code: Select all
FOR /F "tokens=*" %%a IN (
'FORFILES /P "!STRING!" /S /D -!AGE! /C "cmd /c IF @ISDIR == TRUE RD /S /Q @path"^
2^>^&1 ^| FINDSTR /I ERROR'
) DO SET "CMDRSLT=%%a"