Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: How do I get Win7 to check if program is running and if not start it?


12 Feb 2013   #1

Win 7 Ultimate 64 bit Retail
 
 
How do I get Win7 to check if program is running and if not start it?

I am running Win 7 64 bit Ultimate. I am trying to figure out a way to check if a program is currently running and if not to automatically start it.

I have a program that has been shutting off randomly on me that I want to run 24/7 and it always seems to happen just after I leave for work. As a result I am trying to figure out how to have Windows check every 15 minutes or so if the program is still open and if not to automatically restart the program. The program doesn't hang but instead just shuts down so I don't need to kill the process. My google skills keep failing me.

My System SpecsSystem Spec
.

12 Feb 2013   #2

Windows 7 Pro. 64/SP-1
 
 

What program might you be referring to.
My System SpecsSystem Spec
12 Feb 2013   #3

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 

You could do it with task scheduler. What you would need to do is start the task every so often with the rule not to start if already running.

How do I get Win7 to check if program is running and if not start it?-screenshot240_2013-02-12.png


My System SpecsSystem Spec
.


12 Feb 2013   #4

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
 
 

Create a file CheckProg.cmd with this contents:

Code:
:OK
REM wait 10 seconds for an answer. Default answer=n
choice /n /t 10 /d n
tasklist |find "notepad.exe"
IF %errorlevel% EQU 0 GOTO OK
REM Not errorlevel 0 so not running. Restart it.
C:\windows\system32\notepad.exe
GOTO OK
Of course replace notepad.exe with real name. And change C:\windows\system32 to real path. Also change 10 to 900 (15*60) if you want it to check every 15 minutes
Doubleclick CheckProg.cmd and let it run. Works?
My System SpecsSystem Spec
12 Feb 2013   #5

Win 7 Ultimate 64 bit Retail
 
 

Thanks for the quick responses. I will give it a try. I setup a task schedule so hopefully that works. I will know when I get home from work.

Quote   Quote: Originally Posted by Layback Bear View Post
What program might you be referring to.
In this case it is Sabnzbd, but in the past I have had a couple other programs like TiVo Desktop and Crashplan do the same thing.
My System SpecsSystem Spec
13 Feb 2013   #6

Win 7 Ultimate 64 bit Retail
 
 

It was working fine that first day, but now task scheduler seems to be having issues somewhat.

I have it marked for do not start a new instance if the task is already running, but it seems to ignore that. I came home to Firefox crashed because it had a ton of new tabs opened. Even though sabnzbd is running it keeps starting it which just causes a new tab to open to load the web ui.
My System SpecsSystem Spec
14 Feb 2013   #7

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 

Not sure if it matters, but was the original instance started the same way (by the task scheduler)?
My System SpecsSystem Spec
14 Feb 2013   #8

Win 7 Ultimate 64 bit Retail
 
 

Quote   Quote: Originally Posted by kado897 View Post
Not sure if it matters, but was the original instance started the same way (by the task scheduler)?
No, I will try that and see how it goes. Thanks.
My System SpecsSystem Spec
Reply

 How do I get Win7 to check if program is running and if not start it?




Thread Tools



Similar help and support threads for2: How do I get Win7 to check if program is running and if not start it?
Thread Forum
How can I check what display I am running on my windows 7 notebook? Hardware & Devices
How to check if HP running Windows 8 will run 7? Hardware & Devices
Solved cannot Check for Updates - Update Service Not Running Windows Updates & Activation
Trouble with running any program in Win7 32 General Discussion
Can't start any program on Win7. Starting circle-icon appears for 2sec General Discussion
Program running on Win7 but wont appear on screen Software
Windows Running Disc Check when rebooting General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 09:03 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33