PPCGeeks

PPCGeeks (http://forum.ppcgeeks.com/index.php)
-   HTC Apache (http://forum.ppcgeeks.com/forumdisplay.php?f=14)
-   -   Script to delete file every so often (http://forum.ppcgeeks.com/showthread.php?t=23491)

PPCFreak 04-07-2008 12:41 PM

Script to delete file every so often
 
I need a configurable program/script that I can set to delete a certain file every so many days.

The file is not in ROM and I can delete it manually but it would be very nice if an automated task could delete this file every day at a certain time..etc.

Much like a .bat file and task scheduler for Windows XP, only for WM6.1.

Thanks.

Perasite 04-07-2008 12:58 PM

Re: Script to delete file every so often
 
Try MortScript. I'm sure it can be done. MortScript will let you set things to occur at a specific time or every x number of hours (or days, minutes, etc.) If you need help with the syntax, let me know, but the MortScript manual is pretty good.

http://www.sto-helit.de/index.php?mo...st&category=18

PPCFreak 04-08-2008 11:24 AM

Re: Script to delete file every so often
 
Yuma,
Can you send me an example .mscr file for this?

Also, how does one start mortscript?

Perasite 04-08-2008 01:08 PM

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.

PPCFreak 04-08-2008 01:54 PM

Re: Script to delete file every so often
 
Yuma; Thanks for the response and exmaple.


All times are GMT -4. The time now is 11:02 PM.

Powered by vBulletin® ©2000 - 2026, Jelsoft Enterprises Ltd.
©2012 - PPCGeeks.com


Content Relevant URLs by vBSEO 3.6.0