Sign in to follow this  
Followers 0
webflight_sf25

%1

5 posts in this topic

Hi!

I want a input to my script.exe

like this one in batch

"script.bat help"

**********************

if %1 == "help" goto help

goto cont

:help

echo.

echo This file can....

echo.

:cont

...

...

...

end

**********************

some one....

Share this post


Link to post
Share on other sites



IfEqual,1,help,goto,help

;- Main program goes here

Exit

help:

;- Help section goes here

Exit

Share this post


Link to post
Share on other sites

Tnx a lot..

I tryed this one

"IfEqual, 0, help, Goto, help"

and its dont work

"IfEqual, 1, help, Goto, help"

This one works fine

Tnx a lot..

:whistle:

Share this post


Link to post
Share on other sites

You are welcome

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

The variable %0% returns the number of parameters which have been used on the commandline.

Run, myscript.exe /1st /2nd /3rd, , Hide

will return %0% = 3

Perfect to check if any or how much parameters have been used, especially if it's mandatory to set some.

MyScript.aut

IfLess, 0,  1, SetEnv, Msg, Hey you! I've always told you to use a parameter ...

IfEqual, 0, 2, SetEnv, Msg, Well -you've decided to a use a second param.\nCongratulations, you've won a trip to Iraq with George W. to search for weapons of mass distraction !

IfEqual, 1, yeehaa, SetEnv, Msg, Hey Webflight_sf25.\nNice to meet you !

MsgBox, 0, Webflight_sf25's - Parameter Detector, %Msg%\nNoParams: %0%

Exit

Edited by Beastmaster

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0