Question : validating parameters in batch file

Good day!

How to validate when passing parameters in batch file.
because i have this batch file
wscript workcollection.bat username password date frrdsn frrdb

what if parameters lacks one or two.

thanks in advance.

Answer : validating parameters in batch file

@echo off

IF "%1" == "" GOTO INCORRECT_PARAMETERS
IF "%2" == "" GOTO INCORRECT_PARAMETERS
IF "%3" == "" GOTO INCORRECT_PARAMETERS
IF "%4" == "" GOTO INCORRECT_PARAMETERS
IF "%5" == "" GOTO INCORRECT_PARAMETERS

REM the actual script
wscript workcollection.vbs username password date frrdsn frrdb

GOTO END

:INCORRECT_PARAMETERS
echo Usage: workcollection.vbs username password date frrdsn frrdb

:END
Random Solutions  
 
programming4us programming4us