Jump to content

Recommended Posts

Posted (edited)

Hi,

 

Yes, I know I got the letters above in the wrong order. Should have been FSRM doh!

 

I'm trying to setup a Custom task to delete files of a certain age in the folder C:\TestFolder. In this example I want all files older than 1 day to be deleted, not moved.

 

I've created a script: C:\Temp\Del.cmd with content: del *.* /s /q

 

File Management Task Action: Custom

 

Executable: C:\Windows\System32\cmd.exe

 

Arguments: /c C:\Temp\Del.cmd

 

Working Directory: Directory to which the file management task applies

 

Command Security: Local System

 

Condition: 1 day since file was created

 

This is working fine, however, It deletes all files regardless of condition. I'm sure this is because I have *.* in the command path. Obviously I can add arguments in the script for the condition but then you may as well just create a windows scheduled task to run this. Any ideas how I can get the script to adhere to the FRSM FMT conditions?

Edited by randle
  • 8 years later...
Posted

Hey there,

 

Did you ever get an answer to this question? fast forward 9 years and I'm trying to do the same thing. Delete files after 60day retention.

 

Thanks

Will

  • 3 weeks later...
Posted

There is a portable app called delage64.exe (https://www.horstmuc.de/wbat32.htm) that I use to do this. Below are a few examples.

 

To delete any files ending .BAK which are older than 5 days:

 C:\Software\delage64.exe "E:\SBBackups\Daily\*.BAK" 5 

To delete any files which are older than 7 days:

 C:\Software\delage64.exe "C:\Windows\TEMP\*.*" 7 

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...