Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to check batch file param number?

Status
Not open for further replies.

ruse7013

Programmer
Apr 10, 2003
25
US
Hello,

What is the proper way to check for the number of command line parameters in Windows?

In Unix there is something like:

# If the number of command-line parameters
# is not 10, then do something.
if [[ $# -ne 10 ]] then
...
fi

How do we "translate" that into a Windows batch file code?

Thanks.
<ruse7013>
 
Hi,

1.) Seems that the Max of Parameters is 9!
2.) I think you can check it that way:

IF "%9"=="" echo lather than 9 Args

Is this what you searched?

Greetings Kuddel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top