Code: Select all
if exist "D:\Test1" if exist "D:\Test2" (
echo OK
) else (
echo Error
)
pause
Code: Select all
if exist "D:\Test1" if exist "D:\Test2" (
echo OK
)
) else (
echo Error
)
pause
Moderator: DosItHelp
Code: Select all
if exist "D:\Test1" if exist "D:\Test2" (
echo OK
) else (
echo Error
)
pause
Code: Select all
if exist "D:\Test1" if exist "D:\Test2" (
echo OK
)
) else (
echo Error
)
pause
Code: Select all
if exist "D:\Test1" (
if exist "D:\Test2" (
echo OK
) else (
echo Error
)
) else (
echo Error
)
Code: Select all
@echo off
setlocal enableExtensions disableDelayedExpansion
set "test=1"
) else (
echo Hello %test%!
set "test=2"
echo Hello %test%!
)
echo ==== versus ===
set "test=1"
if "1" == "2" (
echo
) else (
echo Hello %test%!
set "test=2"
echo Hello %test%!
)
goto :eof
Code: Select all
set "ok="
if exist "D:\Test1" if exist "D:\Test2" set "ok=1"
if defined ok (
echo OK
) else (
echo Error
)
pause