Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!ucsd!sdcc6!sdcc13!pa1256 From: pa1256@sdcc13.ucsd.edu (Jennifer's Lover) Newsgroups: comp.sys.ibm.pc Subject: Where oh where does my program reside?? Keywords: the and if then where who what when why how question answer Message-ID: <1407@sdcc13.ucsd.edu> Date: 24 Oct 89 00:12:56 GMT Organization: University of California, San Diego Lines: 28 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". The reason I want foo.exe to know where it was called from is so that I can look in the same directory for other files which it needs. I know this can be done other ways, but I want to do it this way. This is what Word-Perfect does when it displays the message: The system is using C:\WP50. Can anyone give me a hand?? By the way, I am using Turbo C 2.0 and DOS 3.xx. Thanks, -Don Woodward pa1256@sdcc13.ucsd.edu