Key Takeaways
- The "Not Recognized as an Internal or External Command" error in Command Prompt can occur due to incorrect command execution or issues with Windows Environment Variables.
- To fix the error, you can change the working directory to System32, verify if the program is correctly installed, or use the full file path to execute the command.
- Additionally, you can add the file path to the Windows Environment Variables or move the program files to the System32 folder for a temporary solution.
The Command Prompt in Windows is a handy utility. It allows you to perform many tasks quickly; however, the command processor may show the "not recognized as an internal or external command" error when you try to execute a command.
It is a common error and usually occurs due to incorrect command execution. This article explains the causes and a few troubleshooting steps to help you fix this error in Windows.
Why the "Not Recognized as an Internal or External Command" Error Occurs
Windows OS keeps a list of paths known as Windows Environment Variables to launch and execute programs quickly. Any issues with it can cause the error.
Potential issues that cause this error include:
- Incorrect commands.
- Registry entries interrupting the functioning of commands and more.
- Executable programs or scripts not installed.
- An incorrectly specified path or filename.
- A missing file directory in Windows Environment Variables.
How to Fix the "Not Recognized as an Internal or External Command" Error
This error is often triggered when you run a program or CMD command, but the Command Prompt fails to find the command or executable in the system's PATH environment variable. If your entered command is correctly formatted, then the issue is likely stems from a missing directory path in the system's PATH environment variable.
Below we have listed fixes for both versions of the error, so follow the relevant one to your case.
1. Change the Working Directory in the Command Prompt

You can quickly fix this error by changing your current working directory C:\users\username in Command Prompt to C:\Windows\System32. The System32 directory contains essential files, including system commands supported by Command Prompt.
A change in the working directory instructs Command Prompt to look for the specified command in the System32 directory. This method should work if the error occurs with any of the system commands.
To change the working directory in Command Prompt:
This is a temporary workaround and should work if you encounter the error with a few specific commands or use them occasionally. A long-term solution will involve looking at issues with the program and configuring Windows Environment Variable to include the file path for the affected program.
2. Verify if the Program Is Installed

Command Prompt can’t run a program that does not exist. If you are trying to execute a newly installed program, ensure it is correctly installed.
To verify the installation:
Alternatively, you can also view installed apps by accessing Apps and Features in Settings. To do this, press Windows key + I, click on Apps and locate the installed app.
By default, when you try to launch a program or a script from CMD, the command processor looks for the related files and paths in the System32 folder or environment variables. If the file is missing, it will return the not recognized as an internal or external command, operable program, or batch file error.
This is likely because Windows does not install most apps in the System32 folder, but C:\Program Files instead.
You can resolve this issue in three ways:
3. Use the Full File Path to Execute the Command

First, let's try the full path method. Here, we will use the full file path instead of the app name to launch programs from Command Prompt. Here's how to do it:
C:\ESBCalcPort.exe 4. Use the Full File Path Within Double Quotes

Command Prompt reads the white spaces as the end of a command and treats anything after the space as a separate command.
Let’s say you want to launch the Internet Explorer app located in C:\Program Files\Internet Explorer\iexplore.exe via CMD. However, running this file path will return an error due to the space between Program Files and Internet Explorer.
To avoid this, you can insert the file path within a double quote. Here, the command to launch Internet Explorer will look like this:
"C:\Program Files\Internet Explorer\iexplore.exe" 5. Add the File Path to the Windows Environment Variables
You can edit the Environment Variables and add the file path of your application to its directory. This way, Command Prompt will identify the path for the entered command and execute it without the error.
Adding a full file path to the Windows Environment Variable can help you resolve the not recognized as an internal or external command error for the Flex, nmake, make, cobra, Is, terraform, gcc, code, Android Studio, Python, Fastboot, and ADB commands.
To edit Windows Environment Variable:


C:\Program Files\Google\Chrome\Application Once you have added the new environment variable, restart your PC to apply the changes. After the PC restarts, open Command Prompt, enter the program's name, and CMD will open it without any error.
If you experience issues with the commands like ipconfig, netsh, cipher, etc., then add the Windows system root folder file path in the Environment Variable dialog. Here's how to do it.

%SystemRoot%\system32 In some instances, the error may persist even after adding the executable directory to the Path environmental variable, especially when you are working with tools like Git or Python. This happens when you try to execute a command or script that is located in a different folder of the same path.
For example, to fix the not recognized as an internal or external command error with git commands, add C:\Program Files\Git\cmd or C:\Program Files\Git\bin to the Path environment variable. Similarly, to execute some commands in Python, you may need to add C:\users\username\appdata\local\programs\python\pythonversion\scripts to the Path environment variable.
6. Move Files to System32 Folder

System32 is a protected system folder, and it is protected for a good reason. When you try to launch a program as an administrator, Command Prompt looks for the executable file in the System32 folder. However, since all the programs are not installed in the System32 folder, you may end up with an error.
If you still want to run the program from CMD and don’t want to type a full file path, you can move the program files to the System32 folder.
To move program files to the System32 folder:
Fixing the CMD Not Recognized as an Internal or External Command Error
Command Prompt commands are not case-sensitive, but it does not forgive the use of extra spaces. To resolve this error, check if the commands are correct and use file paths with spaces within double-quotes. For the programs not installed in the System32 folder, add an environment variable with your application’s full file path to launch apps through CMD.
ncG1vNJzZmivp6x7rq3KnqysnZ%2Bbe6S7zGiuoqaUpMS0ec2oq2aqlZi8qLrIs5ydZZGoeqK6jKKlrZ2io66tec6rZJ6wpJq%2Fr63LZpqopZ2Wu6V5xKupqKpf