Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!fxgrp!ljz From: ljz@fxgrp.UUCP (Lloyd Zusman) Newsgroups: comp.sys.ibm.pc Subject: Another twist on DOS environment sizes. Message-ID: <629@fxgrp.UUCP> Date: 20 May 88 05:22:03 GMT Reply-To: ljz%fx.com@ames.arc.nasa.gov (Lloyd Zusman) Organization: Master Byte Software, Los Gatos, California Lines: 56 I know about the /E:XXXX parameter to COMMAND.COM which, in later versions of DOS, will allow you to set the size of your enviroment. So, by typing ... COMMAND /E:4096 ... I will be in a DOS subshell with 4K of enviroment space. But many programs, as part of their normal operations, will allow you to get into a DOS subshell. Presumably, these programs either run COMMAND.COM directly, or they look at COMSPEC and use whatever it is set to. In either case, very few (if any) of these programs bother to pass /E:XXXX to the command processor when they start it up. This results in the subshell allocating just enough space to hold the parent's environment, NOT COUNTING THE UNUSED ENVIRONMENT SPACE. In other words, if the parent was invoked with /E:4096 and the child was invoked without any /E parameter, and if the parent had, say, 256 bytes of its enviromnent in use, the child would only end up with just a few bytes more than 256 bytes of enviroment space, making it damn near impossible to set any new environment entries. [ note that there is a minimum size for an environment ... I'm talking about cases where more than the minimum size is in use ]. I can think of two ways around this, neither of them totally acceptable: 1) Patch COMMAND.COM so that the default enviroment size is large enough. This is a bad practice, in general, but I guess I could do it if nothing else is possible. 2) Every time I enter a subshell generated by a program, I should type ... COMMAND /E:XXXX ... where XXXX is big enough. This would put me in a sub-sub-shell with enough environment space. But this is an annoyance, and it takes up more memory (but is it true that DOS subshells only use up a small amount of extra memory?). Can any of you think of any other way around this problem? Is there some magic memory location in which I can put the default size of a subshell's environment (i.e., a memory location that is fixed and not relative to the load point of some subshell or another)? Any other ideas? By the way, I am running vanilla PCDOS 3.30. Thanks in advance for any help you can give me. -- Lloyd Zusman UUCP: ...!ames!fxgrp!ljz Master Byte Software Internet: ljz%fx.com@ames.arc.nasa.gov Los Gatos, California or try: fxgrp!ljz@ames.arc.nasa.gov "We take things well in hand."