Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
October 13, 1998
In tip tip 760, we prevented an application from starting if it was already running.
Using TLIST, is a better way. Here is a sample AppName.bat:
@echo off
tlist|find /i "appname.exe" > %TEMP%appname.tmp
for /f "Tokens=1-2*" %%i in (%TEMP%appname.tmp) do call :run "%%j"
start /wait /D [Other Switches and parameters] appname.exe
del /q %temp%appname.tmp
exit
:run
if /i %1=="appname.exe" exit
:end
You May Also Like