How to Fix: “Is Not Recognized as an Internal or External Command, Operable Program or Batch File” error

The Command Prompt lets you run a variety of executable files and get complex tasks done in a jiffy. Through it, anyone with an administrator’s account can access and change settings that otherwise wouldn’t be possible.

But this command interpreter has a specific language that one must know how to read and write. Even the smallest mistake can render the command useless and generate error messages. One of the most common ones being the “not recognized as an internal or external command…” error.

So, what exactly causes this “not recognized as an internal or external command” error and how can one fix it? We’ll explain.

Related: Common Windows 10 2004 issues and available fixes: Detailed list

What does the “is not recognized as an internal or external command” mean?

This error message could basically mean one of two things:

  • The filename of the executable was entered without extension and without the whole path.
  • Windows didn’t find the executable that matched the filename, including its extension, in any directory mentioned in Environment Variables “Path”. 

“Is not recognized as an internal or external command” error causes:

The error occurs, as the message itself suggests, when the Command Prompt program cannot recognize the file or program that you wanted to use or execute. But there can be other problems too.

1. Executable or script not installed

It is possible that the program that you want to execute via command prompt isn’t installed properly on your system. A corrupt installer is the most common cause for this. Either that or the installed executable file is not located in the directory where the command interface is looking for it. 

2. Filename and path not specified correctly

The most common cause of the error is a typing mistake while entering the command. Moreover, if you haven’t specified the path properly, the command prompt wouldn’t know where to look for the file and thus, render the error.

If you’re getting the error, it is important to check your command character by character to ensure it is specified correctly.

3. File Directory not found in Windows Environment Variables

Another possibility is that the directory of the file that you’re trying to execute doesn’t exist in Windows Environment Variables. The series of directories known as “Path” resides under System Variables in Windows Environment Variables, and is required for the commands to be executed. That is where your file directory must be as well, especially if you’re not specifying the complete path of your file in the command prompt. 

But some programs, viruses, and malware can change these environment variables.  If this happens, then the command Prompt wouldn’t be able to recognize the commands or execute them.

4. Executables in system32 not found on 64-bit Windows

For those using 64-bit Windows, there can be another potential cause of the error.

Windows 64-bit programs have “C:\Windows\System32” as their directory, while 32-bit programs have “C:\Windows\SysWOW64” as their directory.

Although most of the executables are found in both of these directories, there are some that exist only in System32, and only a handful in SysWOW64.

By default, the Windows Environment Variables “Path” contains the folder C:\Windows\System32. That means when running in a 64-bit environment, the command prompt is looking for the path directory in C:\Windows\System32. Therefore if you want to run 32-bit programs, you have to execute them in a 32-bit environment.

6 ways to fix the “is not recognized as an internal or external command” error

Fixing the “not recognized as an internal or external command” error mainly has to do with correcting the problems mentioned above. With that in mind, let us look at the fixes one at a time.

Method 1: Check if the Program is installed

First and foremost, ensure that the program that you’re trying to execute through Command Prompt is actually installed on your system and is at the appropriate location. 

Here is how you can do so:

  1. Press Win+I to open the Settings app, select Apps on the left, and Installed Apps on the right.
  2. Scroll through and check the list for the app.
  3. Alternatively, press Win+E to open the File Explorer and navigate to C:\Windows\System32. This directory contains all your applications’ system files. Scroll through and check if your program is available here (use the search box to look for your program faster).

Note: If it’s not, the application is not installed in this folder and you most likely can’t execute the application by simply typing in its file name. This matter can be addressed by the following.

Method 2: Move the file to the System32 Folder

When you’re trying to run a program or an executable file from Command Prompt, the latter searches through the System32 folder and runs the file. But if the file is not there, as can be the case with some programs, you can move it to the System32 folder. Here’s how you can do so.

Note: You will need to be logged in to an administrative account for the following.

  1. Open your program’s location and copy all the files that are in the folder (select all the files and press Ctrl+C for this). In our example, we want to run Microsoft Edge (msedge.exe) through the command prompt and copy all the files present in the application’s folder.
  2. Then paste the files (Ctrl+V) in the C:\Windows\System32 folder.
  3. Now, if you enter the name of the executable file, your command will run without errors.

Method 3: Provide the full path of the file

The Command Prompt doesn’t know where the file is located. So if you don’t want to copy the files to the System32 folder, you will have to specify the exact location of the executable that you want to run.

  1. Go to the folder where your file is installed and take note of the full path of the file. Copy this path as given in the address bar if you wish.
  2. Then paste or type the full path in the command prompt and press Enter.

Note: This method works only if there are no spaces in your command. If there is a space somewhere in your file’s path, then you have to do the following.

Method 4: Insert the whole file path within double quotes

In the command prompt, a “space” is read as the end of the command. Anything entered after a space entered through the “space” or “tab” key will be read as an argument. So, if there are spaces in your file path’s location, ensure that you enclose the path within double quotes. 

  1. Open the file location of your app and note the full path as given in the address bar.
  2. Alternatively, open the folder with the executable file of your program, right-click, and select Copy as path.
  3. Insert the whole file path in the command prompt and book-end them with double quotation marks or paste the path copied (in step 3). You should see the double quotation marks applied automatically. 

Method 5: Change Environment Variables

Windows Environment Variables is the list of paths to common system applications that the Command Prompt uses to execute programs swiftly. If these environment variables are altered, the command interface won’t be able to find the location of the executable and render the error. 

A simple way to fix this is by editing the environment variables and adding the appropriate file path there. Doing so will also allow you to run the executable by entering just the name of the file. This is how you can do so:

  1. Press Start, search for ‘Environment Variables’, and select Edit the system environment variables.
  2. Click on Environment Variables.
  3. This will open up the “Environment Variables” window. Here, under “System variables” click to select the Variable that says Path, and then click on Edit.
  4. Now, to add a new variable value (file location), click on New.
  5. Here, add the folder path to the program/application you want to run through Command Prompt. Do this by simply going to where your application is installed and copying the path.
  6. Then paste it into the environment variable window.
  7. Alternatively, click on Browse.
  8. Then navigate to the folder, select it, and click on OK.
  9. Once you have added this new environment variable for the Command Prompt to access, click OK on all open windows.

If you now open Command Prompt and simply enter the name of the executable file, your application will open promptly.

Method 6: Change directory to SysWOW64

As mentioned earlier, there are some 32-bit programs that only work in a 32-bit environment. And since the directory for these is C:\Windows\SysWOW64, you will have to tell the command prompt to look for it here, and not in the usual system32. Here’s how to do so:

  1. Open the command prompt and type cd C:\Windows\SysWOW64.
  2. Hit Enter. Your directory will change and the command prompt will now look for your 32-bit executable here.

Fix: Python is not recognized as an internal or external command

If you’re getting the same error when running Python through the command prompt, it is highly likely that Python’s executable file is missing from the environment variables. Here’s how to fix it:

  1. Find Python’s installation folder, which is generally C:\Users\(username)\AppData\Local\Program\Python\Python(version)
  2. Add it to the “Path” variable in Environment Variables (as shown in Method #05 of the previous fix).

You will be able to run Python from the command prompt.

Fix: Python command opening Microsoft Store

Sometimes, running “python.exe” in the command prompt will redirect you to the Microsoft Store. This is because Microsft embeds a couple of ‘fake’ executables in the folder and puts their app executable aliases in the On position. Here’s how to fix it:

  1. Press Start, type Manage app execution aliases, and select it.
  2. Toggle off Python.exe and Python3.exe. 

You should be able to run python.exe from the command prompt now without being redirected to where you don’t want to go. 

Android Studio: is not recognized as an internal or external command

Android Studio has its own terminal command for executing commands and the same error is encountered here when trying to run the ‘adb’ command. The cause of the problem here tends to be the incorrect path to the adb folder. But it can be solved with ease if you know where the adb.exe file is located. 

  1. Open Android Studio and click on File.
  2. Select Settings.
  3. Under ‘Tools’, click on Terminal.
  4. In the ‘Start directory’, enter the complete location to adb – C:\Users\(username)\AppData\Local\Android\Sdk\platform-tools
  5. Restart Android Studio.
  6. Alternatively, you can change the directory in Android Studio’s terminal itself. Simply type in the command cd C:\Users\(username)\AppData\Local\Android\Sdk\platform-tools

Now, you should be able to run adb from Android Studio’s terminal command.

CMD: Fastboot or ADB is not recognized as an internal or external command

Lastly, if you have downloaded Fastboot and are not able to execute the adb command from cmd, then it means you have to set the path to ADB in System Variables (in Environment Variables). 

  1. Search for ‘System Variables’ in Start and select Edit the system environment variables.
  2. In the ‘System Properties’ window, click on Environment Variables.
  3. Select Path under ‘System variables’ and click on Edit.
  4. Click New.
  5. Enter the full path to where the platform-tools folder is located (which contains adb.exe). 
  6. Click OK.
  7. Restart the command prompt and you should be able to execute the adb command.

Entering the right commands in the interface and ensuring that the latter has access to the executable file is all that it takes for the command prompt to run the program/file/application that you have told it to. So make sure you follow the fixes mentioned above and run your commands without any more errors.

RELATED

1 Comment

  1. This was a comprehensive post on hoe to solve the error that i have been trying to solve with no success for a while. Thanks for this. Was easy to follow and the steps which were mentioned was particularly effective, meaning, to further follow the next methods to try and clear the error. Well done and thanks again for this solution!!

Comments are closed.