The following simple batch file doesn't work as expected. It's meant to accept an argument, and if none is supplied, it uses a default value ("default", in this case).
Instead, if there is no argument supplied, it assigns an empty string to the variable Arg.
Test.bat:
@echo off
set Arg=%1
if "%Arg%"=="" (
set Arg=Default
echo No Arg, so use default value=%Arg%
) else (
echo Arg=%Arg%
)
pause
The output of Test.bat is:
No Arg, so use default value=
Press any key to continue . . .