When you type a command in Command Prompt or PowerShell and Windows replies with ‘is not recognized as an internal or external command’, it means the system cannot find the executable file. This usually happens because the program isn’t installed, the PATH environment variable is wrong, or the command needs different permissions. This guide walks you through the most common fixes, from simple checks to editing system settings.
What You’ll Need
- A Windows PC with administrator access (needed for some steps)
- The exact name of the command that is failing
- Knowledge of where the program is installed (if you know it)
Step-by-Step
- Check for typos and case. Windows commands are usually case-insensitive, but a misspelling is the most common cause. Type the command again slowly. For example,
ipconfigis correct,ipcongifis not. If the command has a space in its name (likegit init), make sure you are not accidentally adding an extra space. - Restart your terminal. If you just installed the software, the terminal may not have refreshed its list of available commands. Close Command Prompt or PowerShell completely and reopen it. Also restart File Explorer if you changed any environment variables.
- Run the terminal as Administrator. Some commands (like
net startorsfc /scannow) require elevated privileges. Right-click on Command Prompt or PowerShell and select Run as administrator. If it works now, the issue was permissions. - Check if the program is actually installed. The command may refer to a program that isn’t on your system. For example,
pythonwon’t work if Python isn’t installed. Look in Settings > Apps > Installed apps or check the Start Menu for the program. If it’s missing, install it from the official source. - Find the program’s installation folder. If the program is installed, locate its
.exefile. For instance, Python is often inC:\Users\YourName\AppData\Local\Programs\Python\Python312\. The folder that contains the.exeis what you need for the next step. - Add the folder to the PATH environment variable. This is the most common fix.
- Press Win + R, type
sysdm.cpl, and press Enter. - Go to the Advanced tab and click Environment Variables.
- In the bottom section (System variables), find and select Path, then click Edit.
- Click New and paste the full path to the folder you found in step 5. Do not include the
.exefile name itself, just the folder. - Click OK on all open windows.
- Open a new Command Prompt window and try the command again.
- Press Win + R, type
- Use the full path to run the command. If you don’t want to edit PATH, you can run the command by typing its full path. For example, instead of
ffmpeg, typeC:\ffmpeg\bin\ffmpeg.exe. This works every time but is tedious. - Check if the command is a built-in shell command. Some commands are part of Command Prompt itself (like
dir,cd,copy) and don’t need PATH. If you get the error for one of these, your system files may be corrupted. Runsfc /scannowin an elevated Command Prompt to repair them. - Check for conflicting aliases or functions. In PowerShell, you might have defined a function or alias that shadows a real command. Type
Get-Command yourcommandto see what it resolves to. If it shows an alias, you can remove it withRemove-Item alias:yourcommand. - Restart your computer. After changing PATH or installing software, a full restart ensures all services and processes pick up the changes.
Common Mistakes
- Adding the wrong path to PATH. You must add the folder that contains the executable, not the executable itself, and not a subfolder that doesn’t have the .exe.
- Editing the wrong PATH variable. There are two: User variables and System variables. If you are the only user, either works, but System variables affect everyone. If you edit the User one, make sure you are logged in as that user.
- Forgetting to open a new terminal. The terminal you already have open will not see the new PATH until you close and reopen it.
- Using a 32-bit command on 64-bit Windows. Some older tools are 32-bit and may be in
C:\Windows\SysWOW64instead ofC:\Windows\System32. The PATH usually includes both, but not always. - Typing the command with a trailing space. A space at the end can cause the error in some cases.
Tips
- Use
whereto debug. In Command Prompt, typewhere yourcommand. If it finds the file, it will print the full path. If it says “INFO: Could not find files”, the command is not in PATH. - Check the PATH order. If you have multiple versions of the same program, the first one in the PATH list wins. If you want a specific version, move its folder to the top of the list.
- Keep PATH entries short. Long paths with spaces are fine, but avoid trailing backslashes. Use
C:\ToolsnotC:\Tools\. - Use the environment variable editor safely. Before editing, copy the existing PATH value to a text file as a backup. If something breaks, you can restore it.
- For portable apps, create a folder. Put all portable tools in one folder like
C:\Toolsand add just that one folder to PATH.
Troubleshooting
If you followed the steps and the command still won’t run:
- Check the exact error message. If it says “Access is denied”, it’s a permissions issue, not a PATH issue. Run the terminal as Administrator.
- If the command is a script (.ps1, .bat, .cmd), you may need to call it with the full filename. For PowerShell scripts, you might need to change the execution policy with
Set-ExecutionPolicy RemoteSigned(run as Administrator) or usepowershell -ExecutionPolicy Bypass -File script.ps1. - If the command works in Command Prompt but not PowerShell, it might be an external command that PowerShell doesn’t recognize by default. Try running it with
.\)prefix if it’s in the current folder, or use the full path. - If the command is a Java or .NET tool, check that the runtime (Java, .NET) is installed and its own PATH entry is correct. Sometimes the tool’s installer adds itself to PATH but the runtime is missing.
- If you just installed the program and it still fails, uninstall and reinstall it. Some installers have a checkbox for “Add to PATH” that is unchecked by default. Look for that option during installation.
- If nothing works, search the web for the exact command name plus “not recognized”. There may be a known issue with that specific tool and your Windows version.
Frequently Asked Questions
Why does ‘pip’ work in Command Prompt but not in PowerShell?
This is usually a PATH issue. PowerShell may be reading a different PATH variable, or you have a profile script that overrides it. Check $env:Path in PowerShell and compare it to the System PATH. You can also try pip.exe instead of pip.
Do I need to restart after changing PATH?
Not always. You need to close and reopen the terminal. A full restart is only necessary if other running programs (like File Explorer) need to see the new PATH for drag-and-drop or right-click menus.
What is the difference between System and User PATH?
System PATH applies to all users on the computer. User PATH applies only to your account. When a command is searched, Windows combines both. If a command is in both, the User PATH takes precedence over the System PATH.
Can I use a relative path in PATH?
No. PATH entries must be absolute paths (like C:\Program Files\MyApp). Relative paths like ..\MyApp are not supported and will be ignored.
Why does ‘npm’ work after installing Node.js but ‘npx’ doesn’t?
This can happen if the installer added the Node.js folder to PATH but not the npm global bin folder. Reinstall Node.js and make sure the option to add to PATH is selected. Alternatively, manually add the folder where global npm packages are installed (often C:\Users\YourName\AppData\Roaming\npm).
What does ‘not recognized as an internal or external command’ mean exactly?
It means Windows has looked for the command in the current directory and in every folder listed in the PATH environment variable, and it didn’t find an executable file with that name. It is not a message about the command being invalid; it’s about it being missing.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- Google Chrome Helper: What It Is & How to Disable
- Fix 0x80070422 on Windows Server (Step-by-Step)
- How to Troubleshoot a Malfunctioning Driver on Windows
- How to Create Folders in Microsoft Outlook
- Fix Status Range List Conflict 0xc0000282 in Windows
- Fix Software Not Uninstalling on Windows 10