Issue
I have an executable name, like "cmd.exe" and need to resolve it's fully-qualified path. I know the exe appears in one of the directories listed in the PATH environment variable. Is there a way to resolve the full path without parsing and testing each directory in the PATH variable? basically I don't want to do this:
foreach (string entry in Environment.GetEnvironmentVariable("PATH").Split(';'))
...
There has to be a better way, right?
Solution
This seems like a pretty good way of doing it already -- as far as I know, searching through the directories in the PATH
environment variable is what Windows does anyway when it's trying to resolve a path.
Answered By - Donut Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.