Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Way to Tell if Parameters exist or not?  (Read 3691 times)

0 Members and 1 Guest are viewing this topic.

hbViatech

  • Guest
Way to Tell if Parameters exist or not?
« on: August 17, 2004, 11:26:38 AM »
Hello All,

I'm trying to create a batch file that accepts a parameter
but if the parameter does not exist I want
to echo to the user that they need to provide the
parameter.. Otherwise I want to use the parameter.

Is there a way to know if the user has entered a parameter.  

I've tried %1==NUL, %1=="" and NOT EXIST %1 all
to no eval...  
I'm pretty sure you can do this, but obviously I just don't know how.

Any assistance greatly appreciated.

Thanks

johnwill

  • Guest
Re: Way to Tell if Parameters exist or not?
« Reply #1 on: August 17, 2004, 01:56:09 PM »
If you use the form:

IF X%1 == X GOTO NOPARM

... it will take the branch if there is no parameter present.


Heather Bozzard

  • Guest
Re: Way to Tell if Parameters exist or not?
« Reply #2 on: August 17, 2004, 02:03:57 PM »
Thanks a bunch..  :)