Код:

@echo off &setlocal enableextensions
set "Var="
if defined Var (echo Defined) else (echo Not defined)
pause
set "Var=Value"
if defined Var (echo Defined) else (echo Not defined)
pause
if defined %Var% (echo Defined) else (echo Not defined)
pause
set "Value=Another Value"
if defined %Var% (echo Defined) else (echo Not defined)
pause
както так