RunWhen Schedule

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
S1013
Newbie
Posts: 5
Joined: Thu Nov 14, 2002 8:03 pm

RunWhen Schedule

Post by S1013 » Mon Dec 09, 2002 8:00 pm

:?: I would like to execute a bat file only if a specific file exits. I have setup the follow macro:
IfFileExists>C:\test\runtest1.txt,merge
Goto>end
Label>merge
DeleteFile>C:\test\runtest1.txt
Run Program>C:\test\rats.bat
Label>end

I have test run it & it works fine. However, if I try to set it up on a RUN WHEN schedule M,T,W,T,F,S,S Starting at 6:00, repeat every 5 minutes, & repeat continuously, it never runs after the runtest1.txt file is built. What could I be doing wrong?

Ernest

Post by Ernest » Tue Dec 10, 2002 3:14 pm

Hi,
if you use a MSched version which provides to compile an exe, check this code - if not, don't waste time to read the following lines ... :wink:

Code: Select all

Label>run
IfFileExists>C:\test\runtest1.txt,merge
Goto>WaitALittle

Label>merge
DeleteFile>C:\test\runtest1.txt
Run Program>C:\test\rats.bat

Label>WaitALittle
Wait>300
Goto>run
OK, you've read it anyway. So, thx for your interest. 8)

Ernest

S1013
Newbie
Posts: 5
Joined: Thu Nov 14, 2002 8:03 pm

RunWhen option

Post by S1013 » Tue Dec 10, 2002 4:08 pm

? You have to create a never-ending loop in the macro ? If you want to run it every 5 minutes or 5 hours it needs to be in a loop? What is the "repeat" time interval option for??

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Dec 10, 2002 4:43 pm

Hi,

You can do either. I think Ernest was just offering a standalone version which doesn't require scheduling and as such would work when compiled.

You can use the repeat option of the scheduler - set a start time and set the repeat interval to 5 minutes. Ensure you have version 7.1.12. There was an issue with 7.1.10 which stopped repeating schedules working. It was fixed in the next build.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Ernest

Post by Ernest » Tue Dec 10, 2002 5:19 pm

Hi S#,
No you don't have to *.
There's a reason why I've pointed to the compiler release (which I don't own, therefore I don't know if a predefined scheduled script will be compiled 1:1 and runs the way you expect it). This script should run without any scheduling options.

I haven't identified any reason why your script isn't working with the RUN WHEN (Macro Properties) settings.
So this was an idea :idea: how to do it :arrow: if you own the compiler release. :?: And by the way - do you ?

300 sec are 5 min :wink: , so if you want to check for that file every five minutes, that's a damn loop look-a-like :lol:
Why not keeping the script alive!
I assume you don't have to shut down the PC for 4,54 min. inbetween :?: :wink:

E.

*as my grandma said "the only thing you have to do is, to die - sometimes"

S1013
Newbie
Posts: 5
Joined: Thu Nov 14, 2002 8:03 pm

RunWhen

Post by S1013 » Tue Dec 10, 2002 7:25 pm

Thank You. The version we had was 7.1.6 & that was the problem.

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts