Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucsd!sdd.hp.com!samsung!xylogics!merk!alliant!linus!mwunix.mitre.org!jcmorris From: jcmorris@mwunix.mitre.org (Joe Morris) Newsgroups: comp.windows.ms Subject: Re: Increasing command.com's environment space Keywords: command.com Message-ID: <110211@linus.mitre.org> Date: 6 Jun 90 17:54:02 GMT References: <6574@vax1.acs.udel.EDU> Sender: usenet@linus.mitre.org Reply-To: jcmorris@mwunix.mitre.org (Joe Morris) Distribution: usa Organization: The Mitre Corporation Lines: 55 In article <6574@vax1.acs.udel.EDU> bill@vax1.udel.edu (William Tsai) writes: >Does anybody know how to increase the environment space used >by variables when executing command.com in a window? >Seems like SHELL= .. /E .. doesn't affect the copy of comman.com >being executed in a window. Try the following: ===== Start file 'envirn33.not' ===== This patch changes the default environment size in COMMAND.COM for DOS 3.3 from its IBM-provided value of 160 bytes. The COMMAND command (both in the SHELL statement in CONFIG.SYS and in the command which establishes a secondary command processor) accepts the /E:xxxx parameter, but when a secondary processor is started it does not honor the size specification of its parent. This can cause significant problems if a user invokes functions which require more environment space than is available while in a secondary command processor environment. The patch will work for PC-DOS 3.3 only. The concept is probably applicable for other DOS variants and other releases, but the verify code (and possibly the patch data) will differ. The value to be changed represents a (two-byte) word containing the size of the default environment space in paragraphs (16-byte blocks). Since the 80*86 architecture inverts the sequence, the low-order byte appears first. The default value is 160 bytes (hex 00A0), so the original data is hex 0A 00; to patch the file to default to 512 bytes (hex 0200) the data should be changed to hex 20 00. Note that the low-order zero is not present. To summarize: For this much space...insert this value...inverted 160 bytes (10 paragraphs) 000A 0A 00 256 bytes (16 paragraphs) 0010 10 00 512 bytes (32 paragraphs) 0020 20 00 The installation script to set a 512-byte default if typed from the console. Executing this from a file would not show exactly the same material. C:\> debug command.com - d eb4 eb9 (show the data where we will patch) xxxx:0EB0 C7 06 60 16 - 0A 00 ...... - e eb8 20 (make the actual patch) - w (write the file back to disk) Writing 62DB bytes - q (exit DEBUG) C:\> ===== end file 'envirn33.not' =====