© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
3 replies
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
gcm
does in powershell or
which
which
on unix)?

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


I don't want to start a process and I don't want to iterate over PATH myself.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ how to get path to folder?
C#CC# / help
3y ago
Get multiple objects in JObject path
C#CC# / help
4y ago
❔ How to get file path of PDFs in project.
C#CC# / help
3y ago
❔ Get full namespace name
C#CC# / help
3y ago