Missed input parameter to be echoed / prompted
Moderator: DosItHelp
Missed input parameter to be echoed / prompted
We have a batch script which takes user input parameters(5 parameters). If by mistake we forget to provide any particular parameter, we want that particular parameter to be echoed out / prompted in dos prompt.
Re: Missed input parameter to be echoed / prompted
If you missed a parameter, what do you expect to get if you will echo it out?
I suppose you get nothing for an empty parameter.
I suppose you get nothing for an empty parameter.
Re: Missed input parameter to be echoed / prompted
Might help if you actually posted the code you are using. Then someone could give you some ideas on adjusting your code.
Re: Missed input parameter to be echoed / prompted
Or use this:
Code: Select all
@echo off
if "%~5"=="" (
echo Try again with the right number of parameters, you numbskull!
pause
goto :EOF
)
echo rest of batch file goes here.