Computing.Net > Forums > Programming > Advanced Batch File

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Advanced Batch File

Reply to Message Icon

Name: BigKahuna
Date: May 30, 2006 at 14:31:40 Pacific
OS: Windows NT
CPU/Ram: slow
Product: thinclient
Comment:

My issue is that I cannot use a vbscript on the thin clients I'm using as the host is too large for the hard drive.
I am trying to make it so when a patron closes a specific program by accident, that program will auto open back up. I need to do this by simple command line if possible as the thin clients i'm pushing this to have extremely space limited memory.
Basic Struct: If process running, good.
Else if process not running, open program.
And this type of logic needs to be running as a daemon process.
Anyone know batch commands to accomplish this? Thanks.



Sponsored Link
Ads by Google

Response Number 1
Name: uli_glueck
Date: May 31, 2006 at 00:54:52 Pacific
Reply:

This Batch should do the job:
(tlist is from the NT-Ressource kit)
------snip
@echo off
VAR=
PROCESS=the name of the process you want check

for /f "tokens=2" %%A in ('tlist ^|find "%PROCESS%"') do set VAR=%%A

if defined VAR (echo good
)else(
call programm
)

set PROCESS=
set VAR=

----------snap

hope this helps
uli


0

Response Number 2
Name: BigKahuna
Date: June 5, 2006 at 12:00:20 Pacific
Reply:

Thanks, that worked beautifully with a few minor custom touch ups.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Advanced Batch File

advanced batch file help needed www.computing.net/answers/programming/advanced-batch-file-help-needed/8803.html

Advanced bat file for copying files www.computing.net/answers/programming/advanced-bat-file-for-copying-files/17021.html

Advanced Batch Files www.computing.net/answers/programming/advanced-batch-files/19256.html