Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!bellcore!att!linac!midway!mimsy!prometheus!media!ka3ovk!wb3ffv!aplcen!simpson From: simpson@aplcen.apl.jhu.edu (Simpson David Grant) Newsgroups: comp.sys.ibm.pc.misc Subject: Re: Path Environment Message-ID: <1991Feb10.043247.28934@aplcen.apl.jhu.edu> Date: 10 Feb 91 04:32:47 GMT References: <14822@chaph.usc.edu> Reply-To: simpson@aplcen (Simpson David Grant) Organization: Johns Hopkins University Lines: 23 In article <14822@chaph.usc.edu> dchun@aludra.usc.edu (Dale Chun) writes: > >Can anyone tell me how to get the starting address of the DOS >environment? Thanks for any information...! > This topic is discussed in "PC Magazine DOS Power Tools" (a book I highly recommend) in Chapter 12 (The DOS Environment). The DOS environment is stored in an area of memory called the "Master Environment Block" which is what is accessed by batch files. Each program has its own copy of the master environment block; offset 2Ch in the programs Program Segment Prefix holds a pointer to where this copy of the master environment block is stored. The book gives the following procedure for displaying the contents of the environment. Type: DEBUG to run DOS's DEBUG program. At the hyphen prompt, display the value of the environment pointer by typing: -D 2C 2D This will display a two-byte pointer (such as 0A 55). Display the contents of the environment by typing -D 550A:0 (or whatever the two bytes were that were displayed, remembering to switch the bytes). Again, the book has more info on this. David Simpson