Path: utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!cica!iuvax!mailrus!csd4.milw.wisc.edu!uakari.primate.wisc.edu!ctrsol!ginosko!husc6!bu-cs!madd From: madd@bu-cs.BU.EDU (Jim Frost) Newsgroups: comp.sys.ibm.pc Subject: Re: Finding a program's path. Message-ID: <36047@bu-cs.BU.EDU> Date: 8 Aug 89 03:53:11 GMT References: <7207@ecsvax.UUCP> Reply-To: madd@bu-it.bu.edu (Jim Frost) Followup-To: comp.sys.ibm.pc Organization: Boston University Distributed Systems Group Lines: 15 In article <7207@ecsvax.UUCP> harris@ecsvax.UUCP (Mark Harris) writes: |I am writing a program which needs to know the path through which |it was loaded (rather than the current working directory). DOS |3.x puts this path in the environment, but DOS 2.x doesn't. Is |there a reasonably simple way to find this path in DOS 2.x? No. One way to do it is to compile the name of the program in and run a path search until you find it. Unfortunately if you rename the program or if you give an absolute path (either to override the path or to get to an executable which is not on the path) you will not be able to find the executable. jim frost software tool & die madd@std.com