Variable not recognized in else statement in a bat file
问题 I have the follow code: ECHO OFF :LOOP set c= setlocal ENABLEDELAYEDEXPANSION tasklist | find /i "calc.exe" >nul 2>&1 IF %ERRORLEVEL% == 0 ( ECHO easymeetingOnCall is running taskkill /IM calc.exe /F set c=true Timeout /T 10 goto LOOP ) ELSE ( IF "!c!" == "true" ( ECHO l'applicazione easymeetingOnCall è spenta. Timeout /T 10 goto exitLoop ) ECHO easymeetingOnCall is not running Timeout /T 5 /Nobreak GOTO LOOP ) :exitLoop My problem is that the follow condition IF "!c!" == "true" Into the else