From: dkmd_nielsen Date: 2008-11-13T06:22:17+09:00 Subject: Re: Need tutoring on using a path environment variable Let's provide more information. The contents of pw_path include this: C:\PW\firstprep;C:\PW\rapid\docs;C:\PW\la;C:\PW\rapid;c:\pw\pst; And the application I want to execute is presort.exe, which is located in c:\pw\pst; I would like to be able to tell the O/S you have to look in the above folders to find presort.exe, just as you would using PATH. In a sense, I would like to temporarily merge the contents of pw_path into the search path of PATH. Is that better? dvn dkmd_nielsen wrote: > I don't know what to do. I have an environment variable, PW_PATH, > that contains the folder names where applications can be executed > from. I want to start a particular application that is in one of > those folders. I currently use the following: > > system("presort /a /nos /watch #{template[0]}") # submit the > presort to run > > This works when the contents of PW_PATH are added to the PATH > variable. But I would like to avoid that if I can. I guess my > questions are: How do I first acquire the contents of PW_PATH? How > do employ the contents as a temporary addition to PATH so that system > can submit the application and it will be found and executed? > > Suggestions? Comments? Observations? All are appreciated. > > dvn