Jump to content

Recommended Posts

Posted

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....

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...