Not Recognized as an Internal or External Command in Windows 11 and 10: Fix PATH and Environment Variables Safely


You type a command that worked on another PC, and Windows replies that it is not recognized as an internal or external command. In Command Prompt the full message reads: 'python' is not recognized as an internal or external command, operable program or batch file. This guide shows how to find the cause before you change anything.
Last reviewed: November 24, 2026. Steps were compared with Microsoft documentation; none was run on a real PC. The picture at the top is an illustration.
Quick answer
Quick answer
- The message means Windows could not find a program with that name in the current folder or in PATH.
- Check for a typo or the wrong folder first, then check whether the tool is installed.
- If you just installed the tool, close every terminal window and open a new one.
- Use where and echo to see whether the tool folder is in PATH.
- To fix PATH, add one folder to the User Path, keep the old value, and open a new terminal.
In this guide
What "not recognized as an internal or external command" means
Command Prompt, called cmd here, looks for a typed name in three places: the built-in commands, the current folder, and the folders in the PATH environment variable. Microsoft's where page says that by default where searches the current directory and the paths in PATH.
The cmd message
Cmd prints the message when none of those places holds a matching program. The name is not wrong to Windows; it simply does not resolve to anything it can run.
The PowerShell message
PowerShell says the term is not recognized as the name of a cmdlet, function, script file, or operable program. The idea is the same: no program, script or function matches the name in your session.
| Where you see it | What it usually means | First thing to check |
|---|---|---|
| Command Prompt (cmd) | No matching program in the current folder or PATH | Spelling and current folder |
| PowerShell | No matching command or program in this session | Whether the tool is installed and the window is new |
| python in a fresh install | A Store alias answers instead of a real Python | App execution aliases |
Causes, in order of likelihood
Work through these in order. The first two cover most cases.
1. Typo or wrong folder
Cmd checks the current folder first, but that folder is often not the one you expect. Check the spelling of the name, then check the folder shown at the prompt.
2. The tool is not installed
General advice: an installer that stopped halfway, or an install made for another user account, can leave no program for the account you are using. Install the tool from its official source, then test again. If an install or uninstall hangs, see the guide on apps that will not uninstall in Windows 11.
3. The window was opened before the install
Commonly reported: a terminal window keeps the PATH it had when it opened. If you installed the tool or changed PATH while a window was already open, that window will not see the change. Close all terminal windows and open a new one. If a tool works after a restart but not in a normal session, a background program may be involved; see how to do a clean boot to find a software conflict.
4. The tool folder is missing from PATH
The program exists, but its folder is not in the list. Running it by its full path works, while the short name fails. This is the main case the rest of this guide fixes.
5. A python App execution alias
On many Windows 10 and 11 PCs, python can open the Microsoft Store instead of running Python. The section on the python alias explains this.
6. A typo in a PATH entry
A misspelled folder in PATH is skipped, so the other folders still work. But if the correct folder is misspelled, the tool will stay unfound.
- Does the full path run the tool?
- Yes: the tool is installed, so the problem is PATH or an old window. Open a new terminal first. Still failing? Add the folder to the User Path.
- No: check the spelling and the folder. If the file is not there at all, install the tool again.
First checks in the terminal
Run these in a terminal you opened after the install. Replace tool with the name you typed.
Check 1: where
where tool
You should see one or more full paths ending in tool.exe. If you see only a path inside WindowsApps for python, go to the python alias section.
If this fails with a message that it could not find the file, the program is not on the search path. Check the folder with check 4 and the installation with the Settings app.
Check 2: echo the PATH in cmd
echo %PATH%
You should see one long line of folders separated by semicolons. Look for the folder that holds your tool.
If this fails and the line is printed literally, you may be in a different shell. Open Command Prompt again from the Start menu.
Check 3: PowerShell's view
$env:Path
You should see the same folders, separated by semicolons. Microsoft's about_Environment_Variables page explains how PowerShell handles these values in a session.
If this fails with an error about the variable, you may be in an older program; open Windows PowerShell from Start.
Check 4: the path command
path
You should see the current command path. Microsoft's path page says that without parameters the command displays the current command path. Type path alone, with no semicolon, so you only look and change nothing.
If this fails and the output is empty, use check 2 instead.
Check 5: run the full path
"C:\Tools\tool\tool.exe" --version
You should see the version or help text from the tool. Use the real folder. The flag can differ by tool, so check its help page if needed.
If this fails with a file not found message, the folder is wrong or the install is incomplete. If the tool starts but reports a missing DLL, that is a different problem; see the guide on missing DLL errors, or the guide on a missing d3dx9_43.dll for that specific file. Some tools also need a DLL registered with regsvr32; if that command fails, see regsvr32 error: module failed to load. If it starts but shows an error about a bad image, see the guide on error 0xc000007b. If a built-in Windows command is the one missing, system files may be damaged; see the guide on SFC repairs that find corrupt files and the guide on DISM source file errors.
| Check | Command | Good result |
|---|---|---|
| where | where tool | A full path to the file |
| cmd PATH | echo %PATH% | A list containing the tool folder |
| PowerShell PATH | $env:Path | The same list in PowerShell |
| Full path | the full path, then --version | Version or help text |
Environment variables and the User Path
An environment variable is a named value that Windows passes to programs. PATH is one of them. Microsoft's about_Environment_Variables page describes three scopes for these values: Machine (System), User and Process.
How the PATH list is built
Commonly reported: the PATH your session receives lists the System entries first, then the User entries. A folder you add to the User Path therefore comes after the System folders. If a System folder already holds a program with the same name, that copy is the one that runs. Programs for 32-bit and 64-bit Windows can also land in different program folders, as explained in 32-bit and 64-bit program folders.
Open the Environment Variables dialog
The quickest route is commonly reported as a search. Click Start, type Edit environment variables for your account, and open the result. You should see the User variables window.
The longer route reaches the same dialog through Settings. General guidance: menu names can differ on your build.
- Start then Settings
- System, then About
- Advanced system settings
- Environment Variables, at the bottom of the Advanced tab
You should see two lists: User variables for your account at the top, and System variables below. If this fails, the wording of the menus can differ on your build. Search Start for the setting instead, or see the Windows 10 note below. If Settings itself will not open, see the guide on Settings not opening in Windows 11.
User and System variables
User variables apply only to your account. System variables apply to every account on the PC. For a tool you installed for yourself, the User Path is the safer place to add a folder, because a typo affects only you.
| Setting | User Path | System Path |
|---|---|---|
| Applies to | Your account only | Every account on the PC |
| Usually needs admin rights | No | Yes |
| Effect of a typo | Affects your commands | Affects every user and program |
Where these values live
Windows stores environment variables in the registry. You do not need regedit to fix this message, and you should not open it to change PATH. This guide does not ask you to change any registry key. For a look-only explanation of the registry control sets that hold these settings, see what CurrentControlSet, ControlSet001 and ControlSet002 are. To read how the registry is organised, see the plain guide to registry hives, keys and values. For a related registry symptom, see the overview of registry problems, symptoms and causes. Startup programs also keep entries in the registry; the guide to registry startup entries shows how to review those safely.
Add one folder to the User Path safely
Before you start
Changing PATH is safe when you add one line and keep everything else. A bad edit can stop commands from running. Copy the old value first, add rather than replace, and do not delete lines you do not recognise. Leave the System Path alone unless you know why you need it. On a work or school PC, ask the administrator first.
Step 1: save a backup of the current PATH
In a terminal, run this command. It writes the current PATH to a file on your Desktop.
echo %PATH% > "%USERPROFILE%\Desktop\path-backup.txt"
You should see no output, and a file named path-backup.txt on the Desktop. Open it in Notepad to confirm it holds the folder list.
If this fails and the file is not on the Desktop, your Desktop may be redirected to OneDrive. Search File Explorer for path-backup.txt. If the file is missing, do not continue until you have a copy.
Step 2: add the folder to the User Path
- In the User variables list, select Path, then click Edit.
- Click New, type the full folder that holds the file, for example C:\Tools\MyTool, and press Enter.
- Do not delete any line. Click OK on each open window until all are closed.
You should see your new folder as the last line of the Path list, with the old lines unchanged.
If this fails because Edit is greyed out, the setting may be managed by your organization. See the guide on settings managed by your organization for next steps, and the comparison of Group Policy and the registry for background. If a permission error appears, see the guide on registry permission errors.
Step 3: open a new terminal and test
Close every cmd and PowerShell window, then open a new one and run:
where tool
You should see the full path to the file in the folder you added.
If this fails, the folder may point to the wrong place. Add the folder that holds tool.exe, not the file itself, and open a new terminal again.
Undo the change
Reopen the User variables window, select Path, and delete the one line you added, or paste the old value from path-backup.txt. Click OK, then open a new terminal. Environment variables sit inside the registry, so a full registry backup is the wider safety net; see how to back up the registry before a change. If the change will not undo cleanly, System Restore can roll the registry back to an earlier date; see undo a bad PATH change with System Restore. If a folder stays in PATH after its program was removed, that line is a leftover; see leftover entries after uninstalling.
Why this guide does not use setx
Microsoft's setx page says that content longer than 1024 characters is cropped, and the cropped text is what gets applied. If that cropped text replaces an existing variable, data already held in it can be lost. A long PATH can reach that limit, so this guide uses the dialog only. If someone sends you a .reg file that claims to change PATH, read it first; see how to read a .reg file before you run it.
The python alias trap
Typing python may open the Microsoft Store, or print a message, even when Python is installed. Windows includes App execution aliases: small stub programs in a WindowsApps folder. Commonly reported, these stubs can be found before a real install in PATH.
Before you start
Turning off an alias only stops the Store shortcut. It does not uninstall Python. If you have no real Python install, switch off the alias only after you install Python from its official site, or you will be left with a message instead of a prompt.
Turn off the python aliases
Open Settings, then Apps, then Advanced app settings, then App execution aliases. General guidance: menu names can differ on your build. If they do, search Start for app execution aliases. Switch off the python.exe and python3.exe entries.
You should see those entries set to Off. Then open a new terminal and run where python. The list should show your real Python folder.
If this fails, the switch may be greyed out, or the aliases may sit in another section. Check where python first; a real path above the WindowsApps path means the real install is found.
How we checked this guide
We compared each step and command with the Microsoft pages listed in Sources. We did not run these steps on a real PC, so labels and menu names may differ on your Windows build.
A note for Windows 10 readers
Windows 10 support has ended
Support for Windows 10 ended on October 14, 2025. Microsoft no longer provides free security updates or technical assistance for it, although the PC still works. Consumer Extended Security Updates run until October 12, 2027 for eligible PCs; see Microsoft's Windows 10 support page. Menus on Windows 10 can be arranged differently from the paths above, so search Start for a setting name if a label does not match.
For more help, the PC repair guides hub lists other Windows fixes. If you are not sure what is wrong, the Repair Assistant can point you to a guide. If a PATH line points to a folder you do not recognise, check the PC first with the guide on removing malware from a Windows PC.
Frequently asked questions
About the messages
What does the message not recognized as an internal or external command mean?
It means cmd could not find a program or batch file with that name in the current folder or in the folders listed in PATH. The cause is usually a typo, a missing install, or a folder that is not in PATH.
Why does the full path work but the short name fails?
The program is installed, but its folder is not in PATH, or the terminal was opened before the change. Running the full path skips the search, so it works while the short name does not.
Is the PowerShell message the same problem?
The cause is usually the same: PowerShell could not find a command, script or program with that name in the session. The wording is different, and the checks for where, PATH and a new window apply in the same way.
Does restarting the PC fix it?
Often, a new terminal is enough because it reads PATH again when it opens. A restart can help after a larger change, but it is not a fix for a folder that was never added.
Fixing PATH safely
Should I add the folder to the User Path or the System Path?
For a tool you installed for your own account, the User Path is the safer choice. It affects only your account, and it does not need administrator rights in most cases. The System Path changes things for every user.
Can I use setx to add the folder?
Not in this guide. Microsoft's setx page says content longer than 1024 characters is cropped, and the cropped text is what gets applied. Use the Environment Variables dialog instead.
How do I undo a PATH change?
Reopen the User variables window, select Path, and remove the line you added, or paste the old value from your backup file. Then open a new terminal and run where tool again to confirm the result.
Why does python open the Microsoft Store?
On many PCs, App execution aliases are found before a real Python install. Turning off the python aliases in Settings stops the Store prompt, but you should first confirm that a real Python install exists.