Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!att!cbnewsc!vgopal From: vgopal@cbnewsc.ATT.COM (venu.p.gopal) Newsgroups: comp.sys.ibm.pc Subject: Re: Where oh where does my program reside?? Keywords: the and if then where who what when why how question answer Message-ID: <4070@cbnewsc.ATT.COM> Date: 25 Oct 89 13:43:11 GMT References: <1407@sdcc13.ucsd.edu> Reply-To: vgopal@cbnewsc.ATT.COM (venu.p.gopal,ix,) Organization: AT&T Bell Laboratories Lines: 18 In article <1407@sdcc13.ucsd.edu> pa1256@sdcc13.ucsd.edu (Jennifer's Lover) writes: >I have a question regarding how to pull some information out of DOS. >I want to know, regardless of the current directory, what directory >my program resides in. >For Example: >If I am in the directory C:\bogus and I run the program foo which >resides in the directory C:\goodstuf, (which, incidentally I can do >because C:\goodstuf is in my path statement) I want to call a function >which will return the string "C:\goodstuf\foo.exe". If you are running DOS 3.0 or greater, you can get this information directly from the PSP area. On DOS 2.x this is not possible. One method is to read the path, then search it in the same order as DOS to find your program. Much easier in DOS 3.0. Venu P. Gopal UUCP: ..!att!ihuxy!vgopal Internet: vgopal@ihuxy.att.com BITNET: com%"vgopal@ihuxy.att.com" or com%"vgopal%ihuxy@research.att.com" Silence those silent letters, save the world 500 million keystrokes a day.