Software Software
asked on
CMD: Make sure that only one parameter has been passed
Hello,
when a batch-file is executed in cmd. I want to make sure that exactly one parameter has been passed.
How can I do this?
when a batch-file is executed in cmd. I want to make sure that exactly one parameter has been passed.
How can I do this?
batch script parameters are named %1, %2, %3 ect (up to %9).
So, Just check if %2 hold any value.
But why don't you ignore additional parameters if you arn't interrested in them ?
It is simplier than an akward checking.
So, Just check if %2 hold any value.
But why don't you ignore additional parameters if you arn't interrested in them ?
It is simplier than an akward checking.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Open in new window
»bp