Solved

how to watch process (exe) is running under window and restart it if it 'die'?

Posted on 2006-07-17
9
280 Views
Last Modified: 2008-02-01
I have a few critical process (exe) programs are running in the background server processes, that are started by scheduler task.   I can see it thru 'taskmgr'.

Now I need to do more:  if any one of the critical processor is 'die', - ie. not in the taskmgr anymore.  How can I re-start it without human attend (or course, it will be nice to be able to send me an email, then start it, and if continue start x times, it will not try to start again).    

1.  Someone told me there is a window utility can do this?  if so, I do not know where to find.  and how to use it
2. if there is NO such utility, anyone know how to write it, or if there is someone sell it.  let me know.

Need experts give me some advise and information on this subject.

thanks

mshox1
0
Comment
Question by:mshox1
9 Comments
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 17122965
You could try something like the script I posted here:
http://www.experts-exchange.com/Programming/Q_21791162.html
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 17124413
if you use xp or higher and your critical tasks are written in service, then use windows OS recovery that available on service
0
 

Author Comment

by:mshox1
ID: 17124522
EDDYKT,  we do use XP or higher to write the program in VB6.  what are you means by written in service?  what is wondows OS recovery that available on services..   can you provide me some direction on getting this info,  especially with examples.

thanks

mshox1
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 26

Expert Comment

by:EDDYKT
ID: 17124687
>>what are you means by written in service?

http://vbwire.com/advanced/howto/service.asp


There is recovery tab on each service and you can configure to restart your service if it fail
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 17124689
>>There is recovery tab on each service

There is recovery tab on each service properties
0
 
LVL 9

Accepted Solution

by:
justchat_1 earned 500 total points
ID: 17127334
This will tell you if a program is running:
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20534084.html?query=isrunning&topics=93

You can check it using a timer (ex:every minute) and use shell to reload it if it crashed

Note: If the program hangs but is still running vb makes it very hard to find out-this will require some serious windows hooks...
0
 
LVL 9

Expert Comment

by:justchat_1
ID: 17291724
I think I answered the question correctly-awaiting an author response
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now