Is Not Recognized as Internal or External Command? Fix
In this article
No, "not recognized as an internal or external command" is not a permanent error—it is a Windows Command Prompt (cmd.exe) message that appears when you type a command that Windows cannot find in the current directory or in the system's PATH environment variable. The fix is usually to correct the command name, use the full path, or add the program's folder to the PATH variable. Below is a complete breakdown of what causes it, how to fix it, and how to avoid it.
What the Error Means
When you run a command in Command Prompt, Windows searches for the executable file in two places: the current folder you are in, and every folder listed in the PATH environment variable. If the command is not in either, you see:
command is not recognized as an internal or external command, operable program or batch file.
This message appears for three main reasons:
- Typo: You misspelled the command (e.g.,
ipconfigvs.ipcongfig). - Program not installed: The software that provides the command is not installed on your system.
- PATH missing: The program is installed, but its folder is not in the PATH variable, so Windows cannot locate it.
Note that this error is specific to Command Prompt (cmd.exe) and older batch files. PowerShell uses a different message: "The term 'xyz' is not recognized as the name of a cmdlet, function, script file, or operable program." The fixes below apply to cmd.exe, but the PATH concept is the same for PowerShell.
How to Fix It: Step-by-Step
Follow these steps in order, from simplest to most thorough. Labels in menus can vary slightly by Windows version (10, 11) and language, but the general path is the same.
- Check for typos. Re-type the command carefully. Commands are case-insensitive in Windows, but spelling must be exact. For example,
ipconfigis correct,ipcongfigis not. - Use the full path. If you know where the program is installed, type its full path. For instance, if you installed Python to
C:\Python39, runC:\Python39\python.exeinstead of justpython. - Add the folder to PATH. This is the most common permanent fix. Open the Start menu, search for "Environment Variables," and select Edit the system environment variables. In the System Properties window, click Environment Variables. Under User variables (or System variables if you have admin rights), select the Path variable and click Edit. Click New and paste the folder path that contains the executable (e.g.,
C:\Python39). Click OK on all windows. Then close and reopen Command Prompt for the change to take effect. - Reinstall the program. If the command still fails, the program may not be installed correctly. Reinstall it, and make sure the installer includes the option to "Add to PATH" (many installers have a checkbox for this).
- Run Command Prompt as Administrator. Some commands (like
netordiskpart) require admin rights. Right-click Command Prompt and select Run as administrator.
Common Commands That Trigger This Error
Many users encounter this error with commands that are not built into Windows but are commonly expected to work. Here are a few examples:
python– Python is not installed by default on Windows. Even if you install it, the installer may not add it to PATH unless you check the box.pip– Pip is bundled with Python, but if Python is not in PATH, pip won't be found either.node– Node.js is not installed by default. The installer usually adds it to PATH, but if you use a portable version, it won't.git– Git for Windows is separate; you must install it and choose the option to add it to PATH.javac– Java Development Kit (JDK) is not installed by default. Even if you install it, you must manually set JAVA_HOME and add its bin folder to PATH.
If you see the error for any of these, the first step is to check if the program is installed. You can do this by looking for its folder in C:\Program Files or by searching the Start menu for the program's name.
Understanding the PATH Variable
The PATH environment variable is a list of directories that Windows searches every time you type a command. When you type notepad, Windows looks in the current folder, then in each folder listed in PATH (in order) until it finds notepad.exe. If it doesn't find it, you get the "not recognized" error.
By default, Windows includes system folders like C:\Windows\System32 in PATH. That's why built-in commands like dir and ipconfig work. Third-party programs must be added manually or by their installer.
There are two PATH variables: User PATH (applies only to your account) and System PATH (applies to all users). You can edit either, but editing the System PATH requires administrator rights. For most users, adding the folder to the User PATH is sufficient.
To see your current PATH, type echo %PATH% in Command Prompt. The output is a semicolon-separated list of folders. To see the PATH for a specific program, you can use where (e.g., where python) to find its location.
If That Did Not Work: Advanced Checks
If you've added the correct folder to PATH and still get the error, try these additional steps:
- Restart Command Prompt. PATH changes only apply to new windows, not to already-open ones. Close and reopen the terminal.
- Check if the file exists. Open File Explorer, navigate to the folder you added to PATH, and verify that the executable (e.g.,
python.exe) is actually there. Some installers place executables in a subfolder likebin. - Use the full path with quotes. If the path contains spaces (e.g.,
C:\Program Files\Node.js), you must enclose it in quotes when typing it manually, but for PATH entries you don't need quotes—just paste the folder path. - Check for conflicting entries. If you have multiple versions of a program, the PATH may point to an old folder that no longer exists. Remove any stale entries.
- Run
cmdfrom the correct directory. If you are trying to run a script that is in a specific folder, navigate to that folder first usingcd(e.g.,cd C:\myproject) and then run the command. If the script is not in that folder, use the full path.
If none of these work, the program may not be installed at all. Search the Start menu for the program name; if it's not there, install it from the official website.
Frequently Asked Questions
Why does my command work in PowerShell but not in Command Prompt?
PowerShell has its own set of built-in commands (cmdlets) and also uses the PATH variable. However, some commands that work in PowerShell are not available in cmd.exe. For example, ls is an alias for Get-ChildItem in PowerShell, but in cmd.exe it is not a built-in command. If you type ls in cmd, you get the "not recognized" error. Use dir instead.
How do I add a folder to PATH permanently?
Open System Properties (search "Environment Variables" in Start), click Environment Variables, select the Path variable under User variables, click Edit, then New, and paste the folder path. Click OK on all windows. The change is permanent for your user account.
Can I use a command without adding it to PATH?
Yes, you can run the executable by typing its full path every time. For example, C:\Python39\python.exe script.py. This is useful for one-off runs, but it's inconvenient for frequent use. Adding to PATH is recommended.
Why does the error say "internal or external command"?
An "internal command" is a command built into cmd.exe itself (like dir, copy, cd). An "external command" is a separate executable file (like ipconfig.exe or python.exe). The error means the command is neither built-in nor found as an external file in the searched locations.
What is the difference between User PATH and System PATH?
User PATH applies only to your user account. System PATH applies to all users on the computer. Editing System PATH requires administrator rights. For personal use, editing User PATH is enough and safer.
Does this error affect batch files?
Yes, if a batch file calls a command that is not in PATH, the batch file will stop and display this error. To fix it, either add the required folder to PATH or use the full path inside the batch file.
Final Thoughts
The "not recognized as an internal or external command" error is a common but easily fixable issue. Most of the time, it's a typo or a missing PATH entry. By understanding how Windows locates commands, you can resolve it quickly and prevent it from happening again. If you're using a program that requires a specific environment (like Python or Node.js), always check the installer's options to add it to PATH—this saves you the manual step later.