07-23-2023, 09:32 AM
Enjoy:
forfiles -p "C:\what\ever" -s -m *.* -d <number of days> -c "cmd /c del @path"
See [`forfiles` documentation][1] for more details.
For more goodies, refer to *[An A-Z Index of the Windows&nbsp;XP command line][2]*.
If you don't have `forfiles` installed on your machine, copy it from any [Windows&nbsp;Server&nbsp;2003][3] to your Windows&nbsp;XP machine at `%WinDir%\system32\`. This is possible since the EXE is fully compatible between Windows&nbsp;Server&nbsp;2003 and Windows&nbsp;XP.
Later versions of Windows and Windows&nbsp;Server have it installed by default.
For Windows&nbsp;7 and newer (including Windows&nbsp;10):
The syntax has changed a little. Therefore the updated command is:
forfiles /p "C:\what\ever" /s /m *.* /D -<number of days> /C "cmd /c del @path"
[1]:
forfiles -p "C:\what\ever" -s -m *.* -d <number of days> -c "cmd /c del @path"
See [`forfiles` documentation][1] for more details.
For more goodies, refer to *[An A-Z Index of the Windows&nbsp;XP command line][2]*.
If you don't have `forfiles` installed on your machine, copy it from any [Windows&nbsp;Server&nbsp;2003][3] to your Windows&nbsp;XP machine at `%WinDir%\system32\`. This is possible since the EXE is fully compatible between Windows&nbsp;Server&nbsp;2003 and Windows&nbsp;XP.
Later versions of Windows and Windows&nbsp;Server have it installed by default.
For Windows&nbsp;7 and newer (including Windows&nbsp;10):
The syntax has changed a little. Therefore the updated command is:
forfiles /p "C:\what\ever" /s /m *.* /D -<number of days> /C "cmd /c del @path"
[1]:
[To see links please register here]
[2]:[To see links please register here]
[3]:[To see links please register here]