C#C
C#3y ago
swagrid

✅ Get full paths to executables in %PATH%

Is there an easy way to get the full path of a program that's available in the shell because of the PATH environment variable (like gcm does in powershell or which on unix)?

e.g. ResolvePath("dotnet") would return C:\Program Files\dotnet\dotnet.exe

I don't want to start a process and I don't want to iterate over PATH myself.
Was this page helpful?