1.

Solve : Residents services and program testing?

Answer»

Residents services and PROGRAM testing

I would like a bat to launch all the services and programs that I usually launch in the startup.
This is because sometimes some of them are closed without my intervention and i WANT to COME back again.
But not with multiple instances.
So I need to test that that process is not running before launch again.

do you know any program or bat for this.

Best Regards
So you want a program that will check if your stuff is running and open it if it isnt? can we get a list of the programs and pathways to them?


preliminary code
Code: [Select]tasklist | find "PROGRAM1.exe" >nul
if %errorlevel% EQU 1 start <path>PROGRAM1.exe

you just copy this a bunch of times for each program you want. if you want it to continually check, use ':loop' at the beginning and 'goto loop' at the end as shown below

Code: [Select]@echo off
:loop

tasklist | find "PROGRAM1.exe" >nul
if %errorlevel% EQU 1 start <path>PROGRAM1.exe

tasklist | find "PROGRAM2.exe" >nul
if %errorlevel% EQU 1 start <path>PROGRAM2.exe

tasklist | find "PROGRAM3.exe" >nul
if %errorlevel% EQU 1 start <path>PROGRAM3.exe

etc...

goto loop


tell me if you get any errors, it may need some tweaking.A slightly more concise option.
Code: [Select]tasklist | find "notepad.exe" >nul ||start notepad.exeQuote from: Lemonilla on October 25, 2012, 01:34:58 PM

So you want a program that will check if your stuff is running and open it if it isnt? can we get a list of the programs and pathways to them?


preliminary code
Code: [Select]tasklist | find "PROGRAM1.exe" >nul
if %errorlevel% EQU 1 start <path>PROGRAM1.exe

you just copy this a bunch of times for each program you want. if you want it to continually check, use ':loop' at the beginning and 'goto loop' at the end as shown below

Code: [Select]@echo off
:loop

tasklist | find "PROGRAM1.exe" >nul
if %errorlevel% EQU 1 start <path>PROGRAM1.exe

tasklist | find "PROGRAM2.exe" >nul
if %errorlevel% EQU 1 start <path>PROGRAM2.exe

tasklist | find "PROGRAM3.exe" >nul
if %errorlevel% EQU 1 start <path>PROGRAM3.exe

etc...

goto loop


tell me if you get any errors, it may need some tweaking.

I use a very large list of residents under windows 7 64 bits, 16GB ram, i7 processor.

I put a screenshot, and may be you can indicate the type of care I have to take in the bat



I can add any other thing you require
Best Regards

Quote from: Squashman on October 25, 2012, 03:09:37 PM
A slightly more concise option.
Code: [Select]tasklist | find "notepad.exe" >nul ||start notepad.exe

Nice indeed. Goes well with programs in my data disks Y: or O: ?


Discussion

No Comment Found