Link to home
Start Free TrialLog in
Avatar of Rockit55
Rockit55

asked on

Need Batch/Script file to run program

We have a small exe program running on a Win2003 server which is necessary for some of our legacy applications to operate.  For some unknown reason, this required exe file stops running.  While we are attempting to discover the reason the program stops, I want to run a simple batch/script file which will: see if the program is running, and if not, run it.
I could set this batch file up as a scheduled task to run every 5 minutes.
ASKER CERTIFIED SOLUTION
Avatar of RobSampson
RobSampson
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If that doesn't work, have you considered running your legacy apps on a virtual server running on top of your SBS?  There's great documentation for it here:  http://sbsurl.com/vs

I've done this a number of times and it usually works so much better to let the legacy apps run on older OS's than new ones.  (Although ideally it's better to dump the legacy apps)  :-)

Jeff
TechSoEasy
Avatar of Rockit55
Rockit55

ASKER

After replacing "notepad.exe" with the file we need to run and saving the code to a text file with a .vbs extension...it seems to be running flawlessly.
Thanks for the help!

Rodney
No problem.  I forgot to mention, there is a line in there that says
WScript.Sleep 5000
which makes the script wait only five seconds to check if the program's not running, so if you feel like you want to check only every minute, use
WScript.Sleep 60000

Regards,

Rob.