Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: notesfiles - hp 1.2 08/01/83; site hp-pcd.UUCP Path: utzoo!watmath!clyde!cbosgd!hplabs!hp-pcd!bobm From: bobm@hp-pcd.UUCP (bobm) Newsgroups: net.micro.pc Subject: Re: command name and DOS 3.x Message-ID: <15200017@hpcvlo.UUCP> Date: Wed, 12-Mar-86 12:59:00 EST Article-I.D.: hpcvlo.15200017 Posted: Wed Mar 12 12:59:00 1986 Date-Received: Sat, 15-Mar-86 19:36:48 EST References: <1301@voder.UUCP> Organization: Hewlett-Packard - Corvallis, OR Lines: 19 Nf-ID: #R:voder:-130100:hpcvlo:15200017:000:879 Nf-From: hpcvlo!bobm Mar 12 09:59:00 1986 Look on page 7-7 of the DOS TechRef. In DOS 3.x, the name used to invoke the program is stored after the enviroment space. To find it, get the word at offset 2CH in the PSP. That's the segment address of the enviroment. Scan through the enviroment a byte at a time until you find two consecutive zero bytes (the end of the enviroment).Following those zeros is a 1-word "count", followed by an ASCIIZ string, which is the drive, path, name and extension of the executing program. I'm not really sure what the "count" is supposed to indicate. It seems to always be set to 1. Also, the string has some wierd uppercase/lowercase conversions. The name and extension of the program are always uppercase, but the drive and path come back in various cases, depending on where the program is, what the path is, the phase of the moon... Bob May hplabs!hp-pcd!bobm