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

brennok

New member
Local time
4:13 AM
Messages
17
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 Computer My Computer

At a glance

Win 7 Ultimate 64 bit RetailIntel i5-2500KG.Skill 2x4gb DDR3 SDRAM DDR3 1600 F3-12800CL...
OS
Win 7 Ultimate 64 bit Retail
CPU
Intel i5-2500K
Motherboard
Gigabyte GA-Z68X-UD3P-B3
Memory
G.Skill 2x4gb DDR3 SDRAM DDR3 1600 F3-12800CL9D-8GBSR
Hard Drives
WD Black 1TB
PSU
Seasonic 660
Case
corsair 600T SE
Cooling
stock
Other Info
Ceton InfiniTV4
What program might you be referring to.
 

My Computer My Computer

At a glance

Windows 10 Pro. 64/ version 1709 Windows 7 Pr...Intel i7-6800K @ 4.3Corsair Platinum 16 gig @2400EVGA GTX 1070 OC
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Home made Desktop
OS
Windows 10 Pro. 64/ version 1709 Windows 7 Pro/64
CPU
Intel i7-6800K @ 4.3
Motherboard
ASUS X-99 Deluxe II
Memory
Corsair Platinum 16 gig @2400
Graphics Card(s)
EVGA GTX 1070 OC
Monitor(s) Displays
Asus 27" LED LCD/VE278Q
Screen Resolution
1920-1080 or 1280-720 HDMI
Hard Drives
INTEL SSD 730-240 Gb Sata 3.0/
PSU
EVGA Platium 1200W
Case
Phanteks Luxe Tempered Glass 8 fans/ one radiator
Cooling
XSPC/ Water Cooled CPU
Keyboard
Das 4 Professional
Mouse
Logitech M705/MX Anywhere 2-S
Internet Speed
100 mbits
Antivirus
Microsoft Security Essentials/ Malwarebytes Premium 3.0/ SAS
Browser
I.E. 11 default/Firefox/ ISP Time Warner Cable/Spectrum
Other Info
LG BluRay Burner/
Sound system-KLipsch-THX/
Icy Dock ssd Hot Swap bays.
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 Computer My Computer

At a glance

Microsoft Windows 7 Home Premium 64-bit Servi...Intel(R) Core(TM) i3 CPU M 330 @ 2.13GHz8 GB DDR3Intel(R) HD Graphics
Computer type
Laptop
Computer Manufacturer/Model Number
Hewlett-Packard/G62-107SA Notebook
OS
Microsoft Windows 7 Home Premium 64-bit Service Pack 1
CPU
Intel(R) Core(TM) i3 CPU M 330 @ 2.13GHz
Motherboard
Hewlett-Packard 1425
Memory
8 GB DDR3
Graphics Card(s)
Intel(R) HD Graphics
Sound Card
Realtek High Definition Audio
Monitor(s) Displays
Builtin
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 60 Hz
Hard Drives
250 GB SATA Hard Disk Drive 7200 rpm
2TB Seagate GoFlex USB 2 Drive
1TB Iomega Prestige USB 2 Drive
1.5TB Iomega Prestige USB 2 Drive (Samsung)
2TB WD MyBook Live NAS.
Mouse
Logitech Anywhere MX
Internet Speed
152 Mbs download 10 Mbs upload
Antivirus
Norton 360
Browser
Chrome
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 Computer My Computer

At a glance

Microsoft Windows 7 Home Premium 64-bits 7601...Intel(R) Core(TM) i3 CPU M 370 @ 2.40GHz4,00 GBATI Mobility Radeon HD 5400 Series
Computer type
Laptop
Computer Manufacturer/Model Number
ACER ASPIRE 5742G
OS
Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
CPU
Intel(R) Core(TM) i3 CPU M 370 @ 2.40GHz
Motherboard
Acer Aspire 5742G
Memory
4,00 GB
Graphics Card(s)
ATI Mobility Radeon HD 5400 Series
Sound Card
(1) AMD High Definition Audio Device (2) Realtek High Defi
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 60 Hz
Hard Drives
WDC WD5000BEVT-22ZAT0
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.

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 Computer My Computer

At a glance

Win 7 Ultimate 64 bit RetailIntel i5-2500KG.Skill 2x4gb DDR3 SDRAM DDR3 1600 F3-12800CL...
OS
Win 7 Ultimate 64 bit Retail
CPU
Intel i5-2500K
Motherboard
Gigabyte GA-Z68X-UD3P-B3
Memory
G.Skill 2x4gb DDR3 SDRAM DDR3 1600 F3-12800CL9D-8GBSR
Hard Drives
WD Black 1TB
PSU
Seasonic 660
Case
corsair 600T SE
Cooling
stock
Other Info
Ceton InfiniTV4
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 Computer My Computer

At a glance

Win 7 Ultimate 64 bit RetailIntel i5-2500KG.Skill 2x4gb DDR3 SDRAM DDR3 1600 F3-12800CL...
OS
Win 7 Ultimate 64 bit Retail
CPU
Intel i5-2500K
Motherboard
Gigabyte GA-Z68X-UD3P-B3
Memory
G.Skill 2x4gb DDR3 SDRAM DDR3 1600 F3-12800CL9D-8GBSR
Hard Drives
WD Black 1TB
PSU
Seasonic 660
Case
corsair 600T SE
Cooling
stock
Other Info
Ceton InfiniTV4
Not sure if it matters, but was the original instance started the same way (by the task scheduler)?
 

My Computer My Computer

At a glance

Microsoft Windows 7 Home Premium 64-bit Servi...Intel(R) Core(TM) i3 CPU M 330 @ 2.13GHz8 GB DDR3Intel(R) HD Graphics
Computer type
Laptop
Computer Manufacturer/Model Number
Hewlett-Packard/G62-107SA Notebook
OS
Microsoft Windows 7 Home Premium 64-bit Service Pack 1
CPU
Intel(R) Core(TM) i3 CPU M 330 @ 2.13GHz
Motherboard
Hewlett-Packard 1425
Memory
8 GB DDR3
Graphics Card(s)
Intel(R) HD Graphics
Sound Card
Realtek High Definition Audio
Monitor(s) Displays
Builtin
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 60 Hz
Hard Drives
250 GB SATA Hard Disk Drive 7200 rpm
2TB Seagate GoFlex USB 2 Drive
1TB Iomega Prestige USB 2 Drive
1.5TB Iomega Prestige USB 2 Drive (Samsung)
2TB WD MyBook Live NAS.
Mouse
Logitech Anywhere MX
Internet Speed
152 Mbs download 10 Mbs upload
Antivirus
Norton 360
Browser
Chrome
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 Computer My Computer

At a glance

Win 7 Ultimate 64 bit RetailIntel i5-2500KG.Skill 2x4gb DDR3 SDRAM DDR3 1600 F3-12800CL...
OS
Win 7 Ultimate 64 bit Retail
CPU
Intel i5-2500K
Motherboard
Gigabyte GA-Z68X-UD3P-B3
Memory
G.Skill 2x4gb DDR3 SDRAM DDR3 1600 F3-12800CL9D-8GBSR
Hard Drives
WD Black 1TB
PSU
Seasonic 660
Case
corsair 600T SE
Cooling
stock
Other Info
Ceton InfiniTV4
Back
Top