Page 1 of 1 1
Topic Options
#153953 - 2005-12-22 10:43 PM Delete files once a day
brewdude6 Offline
Hey THIS is FUN

Registered: 2000-10-21
Posts: 280
Loc: Nashville, TN
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

_________________________
I could have made a neat retort but didn't, for I was flurried and didn't think of it till I was downstairs.
-Mark Twain

Top
#153954 - 2005-12-22 10:52 PM Re: Delete files once a day
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4446
Loc: USA
See if this will help...

ONEADAY() - Run a program once a day

Top
#153955 - 2005-12-23 04:32 PM Re: Delete files once a day
brewdude6 Offline
Hey THIS is FUN

Registered: 2000-10-21
Posts: 280
Loc: Nashville, TN
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.
_________________________
I could have made a neat retort but didn't, for I was flurried and didn't think of it till I was downstairs.
-Mark Twain

Top
#153956 - 2005-12-23 08:01 PM Re: Delete files once a day
brewdude6 Offline
Hey THIS is FUN

Registered: 2000-10-21
Posts: 280
Loc: Nashville, TN
got it to work using %comspec%
_________________________
I could have made a neat retort but didn't, for I was flurried and didn't think of it till I was downstairs.
-Mark Twain

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 191 anonymous users online.
Newest Members
thequeen, ameliaryan, shalomsalami, dkdssdk, Vroon
17639 Registered Users

Generated in 0.062 seconds in which 0.036 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org