The command prompt in Windows is a handy utility. It enables you to perform many tasks quickly; However, the command processor may display a "Not recognized as an internal or external command" error when you try to run a command.
This is a common mistake and usually occurs due to incorrect command execution. This article explains the causes and some troubleshooting steps to help you resolve this error.
Why does the "Not recognized as an internal or external command" error occur?
The Windows operating system maintains a list of paths known as Windows environment variables for quickly starting and running programs. Any problems with it can cause the error.
Possible problems that are causing this error are:
Registry entries that break commands and more from working.
Executable programs or scripts not installed.
An incorrectly specified path or file name.
A missing directory in Windows environment variables.
How to fix "Not recognized as an internal or external command" error
This error is often triggered when you're running a program or a CMD command and something goes wrong. We have listed fixes for both versions of the error, so follow the one relevant to your case.
1. Make sure the program is installed
The command prompt cannot run a program that does not exist. If you are trying to run a newly installed program, make sure that it is installed correctly.
To check the installation:
Press Profit + r Run to open. Then enter steering and click OK.
Then go to the Control Panel Programs> Programs and Features.
Scroll through the list of installed apps and find the app that you want to run.
Alternatively, you can also view installed apps by accessing Apps and Features in Settings. To do this, press Windows key + me click on Apps and find the installed app.
By default, when you try to start a program or script from CMD, the command processor looks for the associated files and paths in the System32 folder or in environment variables. If the file is missing, the error is returned that was not recognized as an internal or external command, executable program, or batch file.
This is likely because Windows doesn't install most of the apps in the System32 folder, but it does C: Programs instead of this.
You can solve this problem in three ways:
First, use the full path of the executable file to start the program.
Second, add the program path to the Windows environment variables.
Finally, move the files to the System32 folder.
2. Use the full file path to run the command
First, let's try the full path method. Here we are using the full file path instead of the app name to launch programs from the command prompt. This is how it works:
First, open the command prompt as an administrator.
Next, enter the full path of the application you want to start. For example, if you have the ESBCalc port lies in the C: Directory, then the command to open the app with the full path looks something like this:
However, this only works if the file path does not contain spaces. If your file path contains a space, enclose the file path in double quotation marks.
3. Use the full file path in double quotation marks
The command prompt reads the spaces as the end of a command and treats everything after the space as a separate command.
Suppose you want to start the Internet Explorer app in C: Program Files Internet Explorer iexplore.exe about CMD. However, if you run this file path, an error is returned due to the space between Program files and Internet Explorer.
To avoid this, you can put the file path inside a double quotation mark. Here is the command to start Internet Explorer:
"C: Program Files Internet Explorer iexplore.exe"
4. Add the file path to the Windows environment variables
You can edit the environment variables and add your application's file path to their directory. That way, the command prompt will identify the path for the command you entered and execute it without errors.
Adding a full file path to the Windows environment variable can help you fix the error not recognized as an internal or external command for Flex, nmake, make, cobra, Is, terraform, gcc, code, Android Studio, Python, Fastboot, etc. ADB Commands.
To edit the Windows environment variable:
Press Profit + r Run to open.
Next, enter steering and click OK to open Control Panel.
Go to System and Security> System. Click in the left pane Advanced system settings.
In newer versions of Windows 10, go to Settings> System> Info. Then click on Advanced system settings under the Associated settings Section.
By doing Progressive Click the tab Environment variables Button.
In the new window under System Variables, select the option path Variable.
Press the To edit Button.
In the edit window, click New.
Here you need to paste the file path of the program you want to run from CMD. For example, if you want to run the Chrome browser that is in C: Program Files Google Chrome Application, then the full file path looks like this:
C: Program Files Google Chrome Application
click OK to add it to the environment variables.
Then click OK in all open windows to save the changes.
After adding the new environment variable, open the command prompt, type the name of the program and CMD will open it with no error.
5. Move files to the System32 folder
System32 is a protected system folder and is protected for good reason. When you try to start a program as an administrator, the command prompt looks for the executable file in the System32 folder. However, since not all programs are installed in the System32 folder, an error can occur.
If you still want to run the program from CMD and do not want to enter a full file path, you can move the program files to the System32 folder.
To move program files to the System32 folder:
Navigate to the installation directory of your program and copy all files into the folder. Here we are going to move Google Chrome files that are in C: Program Files Google Chrome Application in the System32 folder.
Next, navigate to C: Windows System32 Folder and paste the copied files. click Yes sir when a UAC prompt is displayed.
Next, open Command Prompt as an administrator, enter Chrome, and press Enter. CMD immediately opens the Google Chrome browser.
Resolving the CMD that is not recognized as an internal or external command error
Command prompt commands are case insensitive, but they do not allow for extra spaces. To resolve this error, verify that the commands are correct and use file paths with spaces in double quotes. For the programs that are not installed in the System32 folder, add an environment variable with the full file path of your application to launch apps via CMD.
15 Windows Command Prompt (CMD) Commands You Need To Know
Command Prompt is still a powerful Windows tool. Here are the most useful CMD commands every Windows user needs to know.
About the author
(30 articles published)
Tashreef is a technology writer at MakeUseOf. With a bachelor's degree in computer applications, he has over 5 years of writing experience and covers Microsoft Windows and everything related to it. When you're not working, you can tinker him on his PC, try out some FPS titles, or check out animated shows and movies.
By Tashreef Shareef
Subscribe to our newsletter
Subscribe to our newsletter for tech tips, reviews, free e-books, and exclusive offers!
Click here to subscribe