Where Is the dotnet Command Executable on Windows?
In this article
The dotnet command executable on Windows is typically located at C:\Program Files\dotnet\dotnet.exe. This is the default installation path for the .NET SDK and runtime. If you installed .NET through the official installer, you will find dotnet.exe in that folder. However, the exact location can vary if you used a different installation method or a custom path. This guide shows you how to find it quickly and reliably.
What You'll Need
- A Windows PC with .NET installed (either the SDK or runtime).
- Access to Command Prompt or PowerShell (standard user is fine).
- Basic familiarity with Windows File Explorer.
Step-by-Step
- Open Command Prompt or PowerShell. Press
Win + R, typecmdorpowershell, and press Enter. - Use the
wherecommand. Typewhere dotnetand press Enter. This lists all matching executable paths in your system's PATH. The first result is the one that runs when you typedotnet. - Check the default installation folder. Open File Explorer and navigate to
C:\Program Files\dotnet. Look fordotnet.exe. This is the standard location for the .NET SDK and runtime installed via the official installer. - If you used the .NET install script, the executable may be in
%USERPROFILE%\dotnetor a custom folder you specified. Check there if the default path is empty. - Verify the version. In Command Prompt, run
dotnet --versionto confirm the executable is working and see which version is active. - Find it via Task Manager (optional). If a .NET process is running, open Task Manager, go to the Details tab, right-click the process, and choose "Open file location". This reveals the folder containing the executable.
Common Mistakes
- Assuming it's always in
C:\Program Files\dotnet. Custom installations or per-user installs can place it elsewhere. - Confusing the SDK with the runtime. Both include
dotnet.exe, but the SDK adds development tools. The executable location is the same if installed together. - Not checking the PATH. If
where dotnetreturns nothing, the folder containing the executable is not in your PATH, so typingdotnetwon't work even if the file exists. - Looking for
dotnet.exein System32. It is not a built-in Windows tool; it comes with .NET.
Tips
- Use
where dotnetin Command Prompt orGet-Command dotnetin PowerShell for a quick answer. - If you have multiple versions, the first path in the PATH environment variable wins. You can reorder entries in System Properties > Environment Variables.
- Keep the default installation path unless you have a specific reason to change it; it simplifies updates and tooling.
- For scripts, use the full path to
dotnet.exeto avoid PATH issues.
Troubleshooting
If where dotnet returns "INFO: Could not find files", the executable is either not installed or not in your PATH. First, check if .NET is installed by looking in C:\Program Files\dotnet. If the folder exists but the command fails, add that folder to your PATH: open System Properties > Advanced > Environment Variables, edit the Path variable, and add C:\Program Files\dotnet. If the folder does not exist, download and install the .NET SDK from the official Microsoft website. After installation, open a new Command Prompt window (so the updated PATH is loaded) and try again.
If you get an "Access is denied" error when running dotnet, check your permissions on the installation folder. Running Command Prompt as administrator can help diagnose, but you should not need admin rights for normal use. If the executable is corrupted, repair or reinstall .NET.
Frequently Asked Questions
Can I move dotnet.exe to another folder?
It is not recommended. The .NET installation includes other files and registry entries that expect the default location. Moving just the executable will break functionality.
Why does where dotnet show multiple paths?
You may have multiple .NET installations (e.g., SDK and runtime, or different versions). The first path listed is the one that runs. You can adjust the order in the PATH environment variable.
Is dotnet.exe the same as the .NET Framework?
No. dotnet.exe is for .NET (formerly .NET Core) and .NET 5+. The older .NET Framework uses different executables and is typically located in C:\Windows\Microsoft.NET\Framework.
How do I find the dotnet executable if I installed via Visual Studio?
Visual Studio installs the .NET SDK to the same default location: C:\Program Files\dotnet. Use where dotnet to confirm.
Does the location change with Windows updates?
No, Windows updates do not move the .NET installation. However, major .NET version updates may install side-by-side in the same folder.
Can I run dotnet from any directory?
Yes, as long as the folder containing dotnet.exe is in your PATH. Otherwise, you must use the full path or navigate to the folder first.