Path: utzoo!utgpu!water!watmath!clyde!rutgers!cmcl2!nrl-cmf!ames!aurora!labrea!decwrl!sun!pitstop!sundc!seismo!uunet!mrmarx!kr From: kr@mrmarx.UUCP (Kelly Roney) Newsgroups: comp.lang.c Subject: Re: Program name Message-ID: <1059@mrmarx.UUCP> Date: 26 Jan 88 18:18:59 GMT References: <11334@brl-adm.ARPA> Reply-To: kr@mrmarx.UUCP (Kelly Roney) Organization: Decision Software Co, Cambridge, MA Lines: 18 In article <11334@brl-adm.ARPA> C08922DB%WUVMD.BITNET@CUNYVM.CUNY.EDU (Don Branson) writes: > I understand that the program name is supposed to be available under >DOS versions 3.00 and above- but it isn't in the PSP. Where is it? According to p. 7-7 of the DOS Technical Reference for v3.1 (verified by my own experience), the program's environment is pointed to at offset 2CH of the PSP. The environment strings are null-terminated, and then the environment itself is null-terminated. Following the two nulls is a count of some unspecified words, which may be a long (I don't recall). Following that is a null-terminated string containing the fully qualified path name of the file being executed. (By the way, this discussion should be in comp.sys.ibm.pc.) -- Kelly Roney {uunet,alliant,masscomp}!mrmarx!kr 51 Spinelli Place (617) 576-7121 Decision Software Co. Cambridge, MA 02138