Get arguments in batch file -


i creating programming language , i'm trying implement command line arguments when run program. when open program file uses batch file called start.bat

start.bat:

@echo off set file=%1  cd %~dp0 title atomscript - %file% java -jar atomscript.jar %file% 

also. understand when making interpreted language, c or c++ recommended. i'm using java prototype it.

okay. problem want run program arguments so: c:/users/user/programs>main.atom arg1 arg2 arg3

the program should print:

arg1 arg2 arg3 

my question is, how arguments command line in batch script?

%1 expands first command line parameter, %2 ... %9 2nd-9th accordingly.

you can pass entire command line %*:

java -jar atomscript.jar %* 

more info.


Comments