Computing.Net > Forums > Programming > batch sending vars as cmd line args

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

batch sending vars as cmd line args

Reply to Message Icon

Name: timothy_aah
Date: July 13, 2008 at 13:57:24 Pacific
OS: xp/vista
CPU/Ram: amd x2 4200/2GB
Comment:

I call an executable from a batchfile, sending some command line arguments to it:

"call filename.exe a b c"

for some reason the following won't work, but would be waaaaaay handier:

"set arg1 = a
set arg2 = b
set arg3 = c
call filename.exe %arg1% %arg2% %arg3%"

so basically I want to store the arguments in variables first, and then send the variables to the exe
any ideas?

thx guys!



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: July 13, 2008 at 17:07:12 Pacific
Reply:

You're not setting %arg1%, you're setting %arg1 %. Actually, let's mono-space these variable names.

%arg1%
%arg1 %


0

Response Number 2
Name: timothy_aah
Date: July 14, 2008 at 05:24:29 Pacific
Reply:

crap, k, my bad, it had to be something stupid like that -__-'
thx! it works fine now


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: batch sending vars as cmd line args

Batch that grabs a random line? www.computing.net/answers/programming/batch-that-grabs-a-random-line/16888.html

Batch file to extract certain lines www.computing.net/answers/programming/batch-file-to-extract-certain-lines/17465.html

Need help with C programming www.computing.net/answers/programming/need-help-with-c-programming/6970.html