Hi!
I want to delete *.wl files that is older than a week ( to save space and speed up indexing of the content from another program )
The script never executes the Else statement for some reason. I have files in the range of 9 days old.
Any help is appreciated - Thanks>
GetFileList>\\bud\worklist\bud\*.wl,files
Separate>files,;,file_names
Let>k=0
Repeat>k
Let>k=k+1
IfFileChanged>file_names_%k%,file_names_%k%
EndIf
Label>save
Until>k,file_names_count
Delete old files
Moderators: JRL, Dorian (MJT support)
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Hi,
Your script should look like this:
GetFileList>\\bud\worklist\bud\*.wl,files
Separate>files,;,file_names
Let>k=0
Repeat>k
Let>k=k+1
IfFileChanged>file_names_%k%,file_names_%k%
EndIf
Until>k,file_names_count
Or simplify it to:
GetFileList>\\bud\worklist\bud\*.wl,files
Separate>files,;,file_names
Let>k=0
Repeat>k
Let>k=k+1
IfFileChanged>file_names_%k%,>7
//delete the file
DeleteFile>file_names_%k%
EndIf
Until>k,file_names_count
Your script should look like this:
GetFileList>\\bud\worklist\bud\*.wl,files
Separate>files,;,file_names
Let>k=0
Repeat>k
Let>k=k+1
IfFileChanged>file_names_%k%,file_names_%k%
EndIf
Until>k,file_names_count
Or simplify it to:
GetFileList>\\bud\worklist\bud\*.wl,files
Separate>files,;,file_names
Let>k=0
Repeat>k
Let>k=k+1
IfFileChanged>file_names_%k%,>7
//delete the file
DeleteFile>file_names_%k%
EndIf
Until>k,file_names_count
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?