From: "A. Sinan Unur" Newsgroups: comp.os.msdos.djgpp Subject: Re: passing variable to calling .bat file Date: 19 Jul 2002 23:34:58 GMT Organization: Cornell University Lines: 32 Sender: asu1 AT cornell DOT invalid (on pool-141-149-207-12.syr.east.verizon.net) Message-ID: References: <3d37ebcc$0$25810$91cee783 AT newsreader02 DOT highway DOT telekom DOT at> NNTP-Posting-Host: pool-141-149-207-12.syr.east.verizon.net X-Trace: news01.cit.cornell.edu 1027121698 2690 141.149.207.12 (19 Jul 2002 23:34:58 GMT) X-Complaints-To: usenet AT news01 DOT cit DOT cornell DOT edu NNTP-Posting-Date: 19 Jul 2002 23:34:58 GMT User-Agent: Xnews/5.04.25 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Florian Sukup" wrote in news:3d37ebcc$0$25810$91cee783 AT newsreader02 DOT highway DOT telekom DOT at: > setenv() did not work at the test I did, I tried work arounds but no > success. setenv cannot modify the master environment here is something i used before: rem === setvar.bat === set myvar <--- make sure there is no newline here. rem === main.bat === copy /y setvar.bat tmp.bat prog.exe > tmp.bat call tmp.bat this works if prog.exe prints the value of myvar to stdout. for multiple variables etc, your program should accept the name of the batch file to generate, and then write the set var=value lines to that file. you can then call the generate file in your batch script. sinan. -- A. Sinan Unur asu1 AT c-o-r-n-e-l-l DOT edu Remove dashes for address Spam bait: mailto:uce AT ftc DOT gov