Well basically paramters can be accessed via the %1-N variables so for example:
Code:
@ECHO OFF
echo %1
this Prints to the screen the first paramter that the bat file receives. if you were to call it like:
C:\> mybatfile someparameter
it would print out
[green]someparamter[/green]
If you need to pass on more paramters, the subsequen parameters can be found in the consecutive variables.
Code:
...
echo The parameters passed were: %1 , %2 and %3
...
if you were to call it like:
C:\> mybatfile param1 param2 param3
it would print out:
The parameters passed were:[green]param1[green], [green]param2[/green] and [green]param3[/green].
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.