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:

  • Wrong orders.

  • 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.

Related: A Beginners Guide to Windows Command Prompt

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

Control Panel installed programs

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:

  1. Press Profit + r Run to open. Then enter steering and click OK.

  2. Then go to the Control Panel Programs> Programs and Features.

  3. 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:

  1. First, use the full path of the executable file to start the program.

  2. Second, add the program path to the Windows environment variables.

  3. Finally, move the files to the System32 folder.

2. Use the full file path to run the command

Run programs with full file path

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:

  1. First, open the command prompt as an administrator.

  2. 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:
    C: ESBCalcPort.exe

  3. 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

Start Internet Explorer with double quotation marks cmd

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.

Related: How to use the equivalent of the "ls" command in Windows

To edit the Windows environment variable:

  1. Press Profit + r Run to open.

  2. Next, enter steering and click OK to open Control Panel.

  3. Go to System and Security> System. Click in the left pane Advanced system settings.

    Advanced system settings

  4. In newer versions of Windows 10, go to Settings> System> Info. Then click on Advanced system settings under the Associated settings Section.

  5. By doing Progressive Click the tab Environment variables Button.

    Edit the path of the Windows environment variable

  6. In the new window under System Variables, select the option path Variable.

  7. Press the To edit Button.

  8. In the edit window, click New.

    Add environment variable for file path

  9. 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

  10. click OK to add it to the environment variables.

  11. 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

Move the Chrome Files 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:

  1. 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.

  2. Next, navigate to C: Windows System32 Folder and paste the copied files. click Yes sir when a UAC prompt is displayed.

  3. 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.

Command prompt with flexing artm

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.

Continue reading

About the author

Tashreef Shareef
(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.

More
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