Solved

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

Posted on 2006-07-17
9
282 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

829 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