When using set /p inside this if block. The variable input is not set to the input value. It is set only on second invocation of the script (as if it was set only after echo %input% line).
if "%1"=="" (
echo "You have to specify the name of the file."
set /p input=File name:
echo %input%
pause
) else (
...
)
What can I do to have variable input set to values which was actually entered?