🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #2642

Re: Passing command line arguments from .bat file to application?

#2642
From: Roy M. Silvernail
Date: Fri, 12 Oct 1990 00:50
28 lines
1293 bytes
brand@janus.Berkeley.EDU (Graham Brand) writes:

> I have been trying, without success, to pass a batch file command
> line argument to a program that is invoked from inside the batch
> file. The batch file has something like:
> 	.....
> 	programname "%1"
> 	.....
> and is invoked as:
> 	batchfilename param
> 
> but programname never gets param. Would someone advise me how to do 
> this correctly? 

The quotes are the problem. If you use simply

        progname %1

and invoke as

        batfile param

progname will get param passed as you wish. For even more control in
batch files, look into 4dos. The batch support is phenominal!
--
Roy M. Silvernail |+|  roy%cybrspc@cs.umn.edu  |+| #define opinions ALL_MINE;
main(){float x=1;x=x/50;printf("It's only $%.2f, but it's my $%.2f!\n",x,x);}
"This is cyberspace." -- Peter da Silva  :--:  "...and I like it here!" -- me
Technical Details
Message-ID: <HJLwq3w163w@cybrspc>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!timbuk!cs.umn.edu!cybrspc!roy
References: <39104@ucbvax.BERKELEY.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!timbuk!cs.umn.edu!cybrspc!roy
From: roy%cybrspc@cs.umn.edu (Roy M. Silvernail)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Passing command line arguments from .bat file to application?
Message-ID: <HJLwq3w163w@cybrspc>
Date: 12 Oct 90 00:50:52 GMT
References: <39104@ucbvax.BERKELEY.EDU>
Organization: Villa CyberSpace, Minneapolis, MN
Lines: 28