1.

Solve : Start unless file is already open??

Answer»

i have a start command that i WANT to skip if the file is already running. Can this be done?One way shown below. I only execute the start command if it is not running elsewhere.

(Assumes the only way the command is called is via this BAT file)

Mac

Code: [Select]@echo off
if x%1==xDoIt goto DoIt
echo Stuff prior to optional START
if not exist z.go start %0 DoIt
echo Stuff after the optional START
goto Adios
:DoIt
echo x>z.go
echo Stuff that was started.
pause
erase z.go
exit
:Adios
JTWork,

To test if a file is in use try this:
[edit]echo.N|copy /-y NUL "%FILENAME%">NUL&&(
echo.%filename% is not open!
)[/edit]
More details are DESCRIBED here:
http://www.dostips.com/DtTipsCopy.php#_Toc131269956

DOS IT HELP?



Discussion

No Comment Found