Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucsfcgl.ucsfcgl.UUCP Path: utzoo!watmath!clyde!burl!ulysses!ucbvax!ucsfcgl!kneller From: kneller@ucsfcgl.UUCP (Don Kneller%Langridge) Newsgroups: net.micro.pc Subject: COMMAND.COM and environment strings Message-ID: <9889@ucsfcgl.ucsfcgl.UUCP> Date: Wed, 18-Jun-86 16:10:19 EDT Article-I.D.: ucsfcgl.9889 Posted: Wed Jun 18 16:10:19 1986 Date-Received: Fri, 20-Jun-86 03:00:43 EDT Reply-To: kneller@ucsfcgl.UUCP (Don Kneller) Distribution: na Organization: Computer Graphics Laboratory, UCSF Lines: 45 I was trying to use COMMAND.COM to exec a batch file from within another program by execking: command /C batch.bat This works fine unless the batch file has commands that try to expand the environment (eg "set xyzzy=a magic word"). Then COMMAND.COM complains with "Out of environment space". In fact the following: C> command /C set xyzzy=a magic word causes the same error message. With COMMAND.COM there is an optional path argument that can also be given: C> command C: /C set xyzzy=a magic word This works, but the current environment variables aren't copied for the new COMMAND.COM. So the following happens: C> set xyzzy=a magic word C> echo %xyzzy% a magic word (the DOS response) C> command /C echo %xyzzy% a magic word (this works ok) C> command C: /C echo %xyzzy% xyzzy% (oops - environment variable xyzzy is not there anymore) Thus there is a tradeoff between having the current environment variables and being able to set new environment variables. Although I have a work- around for my particular situation, does anyone know of a general solution? I've tried this on PCDOS 2.0 and 3.1 with the same consequences. This is *not* a problem with having a small environment. I think it is a problem with COMMAND.COM being loaded after the current environment but trying to modify the current environment. If it tries to add to the current environment it sees that it needs more memory, but it can't get more memory because there is a program using the memory it wants. Of course, the program using the memory is the loaded version of COMMAND.COM. -- Don Kneller UUCP: ...ucbvax!ucsfcgl!kneller ARPA: kneller@ucsf-cgl.ARPA BITNET: kneller@ucsfcgl.BITNET