You are not logged in.
Pages: 1
Hi everyone, I wrote a very simple batch file, being that I'm new with if statements within batch i wanted to know how to correct this. I want my if statement to check if the user hasn't input anything and then provide a usage output. what did i do wrong?
@echo off
if "%1" == "" (
echo Usage: %0 arg1
exit /b
)
set /p option=Enter Username:
echo Your Username is %option%
echo Your secret Number is %random%
pause
cls
echo Thank you for using Joes Program %option% Enjoy your day!
pause
Offline
You aren't actually doing anything with arg1 (%1), but other than that I can't see any errors.
Can you describe what it's doing/not doing that you're not happy with?
Last edited by bluesxman (02 Apr 2019 15:39)
cmd | *sh | ruby | chef
Offline
Pages: 1