java - Running file through a program with arguments -


my issue here can't seem pass arguments through program. i'm not sure how explain here goes:

i want able run script file through custom interpreter arguments.

for example:

atomscript.exe main.atom -> program runs

when want run through batch file:

main.atom -> program runs

now when want pass arguments through program using atomscript command in batch file:

atomscript.exe main.atom arg1 arg2 -> program runs arguments

the arguments passed. when want use simple main.atom command run arguments doesn't work:

main.atom arg1 arg2 -> program runs without arguments

i'm not sure @ point. suggestions?

main.atom not executable, can't take parameters

windows knows, program has started , (ignoring parameters)

only if start executable directly, can define parameters (the first 1 being main.atom)

for example:

c:\>assoc .txt .txt=txtfile  c:\>ftype txtfile txtfile=%systemroot%\system32\notepad.exe %1 

assoc defines, filetype extension ("txtfile")

ftype defines, has done filetype (start notepad)

you can see, there 1 parameter %1 (the filename (main.atom)). of course expand more parameters (needs run administrator):

ftype txtfile=%systemroot%\system32\notepad.exe %* 

(which makes not sense example), don't recommend (it's done on computer). better use "official way": in batchfile same on commandline: start executable desired parameters:

atomscript.exe main.atom arg1 arg2     

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -