Re: Check to see if a Prog is running...

Rocket Ray (areray@io.com)
Thu, 12 Sep 1996 08:04:51 -0500

woody@interactive.net (Mark Weinstock) wrote:
> Does anyone know if there's a way to check to see if a program is already
> running in Win95? I often send/receive mail and forget to close down Yarn
> when I do it. My batch file bombs out when I try to import news and Yarn is
> running. What I'd like to do is have the batch file check to see if yarn is
> running, then pause and tell me to close Yarn before it continues. This way
> I wouldn't have to manually import the news/mail after my batch file dies.

I'm unfamiliar with Win95, but it would be easy to do in DOS. Just
start Yarn from a batch file, e.g. y.bat:

@echo off
echo active > c:\temp\y_status
c:\yarn\yarn
del c:\temp\y_status

Then your second batch file could check for the existence of the
y_status file, and refuse to run if it's there:

if exist c:\temp\y_status goto conflict
[rest of second batch file, same as before]
:conflict
echo "Can't run this program while Yarn is running!"
exit

This would work fine in DOS. Hope maybe this helps.

RR

...Friends don't let friends drive Chevies.

--
in austin, texas                    <live music capital of the world!>
http://www.io.com/~areray                    Festina lente.
 [or finger areray@io.com for PGP public key and kewl .plan!]
"The sun is gonna shine... in our back yard... some day."   :)  :)  :)