brewdude6
(Hey THIS is FUN)
2005-12-22 10:43 PM
Delete files once a day

I've got a script that moves files around based on date and other criteria, but I want to do a one time delete of the files in a directory as part of the main script, but I only want to run it once and I want to run it the next time the scheduled process runs after 4pm. The scheduled process runs every 15 minutes. If I leave the script as posted, I'll delete files I want to keep potentially 3 different times. Any suggestions on an easy way to do what I want?
Code:

;Clean reports out of rptsmail folder
$rptsmaillog = "c:\temp\parselog." + $date + ".txt"
$folder3 = "c:\temp\temp3"

If Val("$Hour") = "16"
Del $folder3 + "\*"
$=writelog2($rptsmaillog,"{{Reports Mail}}",1)
EndIf



AllenAdministrator
(KiX Supporter)
2005-12-22 10:52 PM
Re: Delete files once a day

See if this will help...

ONEADAY() - Run a program once a day


brewdude6
(Hey THIS is FUN)
2005-12-23 04:32 PM
Re: Delete files once a day

Thanks, that is definately a better way than using a check type file in the file system. I'm having trouble getting a kixtart command to work as a $program such as this.

Code:

$folder3="c:\temp\temp3\*"
$program = 'Del "$folder3"'
$=oneaday($program)



Any suggestions are of course appreciated.


brewdude6
(Hey THIS is FUN)
2005-12-23 08:01 PM
Re: Delete files once a day

got it to work using %comspec%