Second script, restarting main script

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Fred
Newbie
Posts: 18
Joined: Sat Aug 05, 2017 4:44 pm

Second script, restarting main script

Post by Fred » Wed May 09, 2018 7:56 pm

How can I run a second script, which restarts my main program if got a critical error and stops working? Or just restarting the program every n seconds regardless if it is running or stopped responding?
As I understood, I cant do it in one program, because if it stops, it will not be able to restart itself.

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

Re: Second script, restarting main script

Post by Marcus Tettmar » Mon May 14, 2018 1:55 pm

Well if you compile your script to a .exe you could have a second .exe kill the process of the first, and restart it. Easy to do every n seconds, but if you want to detect it being stuck that depends what makes it look stuck as to what you can detect.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

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