I have following batch script which opens a file and wait for process to close than read from the file
@ECHO OFF
call file.txt
:wait
tasklist /M notepad++.exe > nul && goto wait
FOR /F %%i IN (file.txt) DO @echo %%i
PAUSE
but it is stuck at the loop itself can someone please suggest what is wrong with it?
please try
call file.txt
:wait
tasklist /fi "imagename eq notepad++.exe" |findstr "notepad++.exe"
if "%errorlevel%"=="0" goto wait
FOR /F %%i IN (file.txt) DO @echo %%i
PAUSE
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments