strategicmor.blogg.se

How to comment in bat file
How to comment in bat file





how to comment in bat file

While running this script output will be: In the batch script, I am printing the passed parameters on the console using the echo.

how to comment in bat file

In this example, I am passing two-parameter emp-id and employee names in the batch script by a command-line argument.

how to comment in bat file

Let’s see an example to understand how to pass parameters in the batch script. Note: %0 is a special case, as this contains the name of the batch file itself. %1 %2 %3 %4 %5 …) but only arguments %1 to %9 can be referenced by number. If you require all arguments, then you can simply use %* in a batch script. The first item passed is always %1 the second item is always %2 and so on. In the batch script, you can get the value of any argument using a % followed by its numerical position on the command line. But before solving this problem I want to introduce with batch parameter.īatch parameters (Command line parameters): So let’s assume a scenario where you need to pass emp-id and employe name from the command line argument in a batch script. In this article, I will explain how to pass parameters in the batch file script by command line arguments.







How to comment in bat file