View Single Post
  #4 (permalink)  
Old 04-08-2008, 01:08 PM
Perasite's Avatar
Perasite
Retired Staff
Offline
Location: Yuma, AZ
 
Join Date: Sep 2006
Posts: 1,929
Reputation: 2026
Perasite is a VIPPerasite is a VIPPerasite is a VIPPerasite is a VIPPerasite is a VIPPerasite is a VIPPerasite is a VIPPerasite is a VIPPerasite is a VIPPerasite is a VIPPerasite is a VIP
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: Script to delete file every so often

Once you install mortscript on your PPC, any .mscr you launch will invoke mortscript as required. What I would do in your case is install mortscript, place my .mscr in /Program Files/Autodelete/ and then put a link to your .mscr in /Windows/Startup/

This code should delete the file /My Documents/file.doc every 3 hours
<code>
SECONDS = 1000
MINUTES = ( 60 * SECONDS )
HOURS = ( 60 * MINUTES )
While (1)
Delete ( "/My Documents/file.doc" )
SLEEP ( 3 * HOURS )
EndWhile
</code>
The SECONDS, MINUTES, HOURS portion is not required, but makes it easier to determine how often the script will run.

You can also write code that would run at a specific time each day. It would need to be in 2 seperate files. Schedule.mscr would be run one time to set the notification queue for the second file. Delete.mscr would be called by the notification queue at the proper time. Nothing would need to be placed in /Windows/Startup/ for this to work. I've never worked with the notification queue, though, and would suggest starting out with the code above.
__________________
Now with VGA support on all software!

Projects: (PeraStats 1.7) (PeraCount with Clock 1.3) (PeraCount 1.3) (PeraProfiler 1.2) (S2U2Lock 1.1)
Reply With Quote