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
brennok

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
Layback Bear

Windows 7 Pro. 64/SP-1
 
 

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

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.

-screenshot240_2013-02-12.png


My System SpecsSystem Spec
.

12 Feb 2013   #4
Kaktussoft

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
brennok

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
brennok

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
kado897

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
brennok

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
Thread Forum
Check Disk running for over 48hrs
Yesterday, I found my laptop unable to start up; I eventually found the issue to be error code 0x490. Nothing worked. No system restore points; no system imaging points; cannot start in safe mode. On the advice of several Google searches I started running check disk. 48hrs later I'm sitting at...
Performance & Maintenance
Stop/Start a program running on a server with a script
Have a licensing server running on a Windows 2012 R2 server that hangs on sessions. The only way to free up the sessions is to restart the licensing server. Is it possible to create a batch file or script to stop and start the licensing server from a desktop on the network?
General Discussion
How to check if HP running Windows 8 will run 7?
Hi, I'm currently in the process of purchasing a new laptop, and I found the HP Pavilion g7-2270us, but unfortunately it comes with Windows 8. I am perfectly happy with 7 and would like to have the option of downgrading if I get the laptop, but I want to see first if I even can, because I read...
Hardware & Devices
Trouble with running any program in Win7 32
Hi, my issue is though all my files, documents, start menu & icons are where they should be if i try to access them it gives me the message "Windows cannot acces the specified device, path, or file. You may not have the appropriate permissions to access them." There is only my profile on the...
General Discussion
Can't start any program on Win7. Starting circle-icon appears for 2sec
Almost no program can start on Windows7 (only succeeded to run notepad and explorer but no IE, chrome, etc.) When I try to run it a spinning circle appears for a couple of seconds (the program names appears in the task manager) and then everything quits silently. no error message, no anything. ...
General Discussion
Program running on Win7 but wont appear on screen
I have a weird problem running Adobe GoLive CS2 (version 8) on Windows 7 - the program runs but wonít appear on screen. I don't get this issue with any other program and until this happened a few days ago the program worked fine on Windows 7. GoLive hasnít been updated for some time but Windows 7...
Software

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 19:29.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App