Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!sdd.hp.com!caen!hellgate.utah.edu!albion.utah.edu!msmith From: msmith%albion.utah.edu@cs.utah.edu (Matthew Smith) Newsgroups: comp.os.msdos.programmer Subject: Re: Passing command line arguments from .bat file to application? Message-ID: <1990Oct11.144501.2417@hellgate.utah.edu> Date: 11 Oct 90 20:45:00 GMT References: <39104@ucbvax.BERKELEY.EDU> Organization: University of Utah CS Dept Lines: 37 In article <39104@ucbvax.BERKELEY.EDU> brand@janus.Berkeley.EDU 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? Well, I'm not sure if you put those ""'s around the %1 in your batch file or not, if you did, you shouldn't. If I called a batch file called BATCH with the parameters A B C D, like such: BATCH A B C D then, inside the batch file, any reference made to %1 would be replaced by A, %2 by B, etc... So, if in the batch file, I wanted to call MYPROG with the first parameter passed to BATCH, my batch file would look like this: MYPROG %1 I think you had the right idea, depending on if you put those quotes there or not... >Cheers, >-Graham (*SWIG*) (*ahhh*) thanks! Matt Smith msmith@peruvian.utah.edu