"'***' is not recognized as an internal or external command, operable program or batch file."

When you enter a command in the Command Prompt in Windows 10 or Windows 11, you may see the message "'***' is not recognized as an internal or external command, operable program or batch file."

For example, some used PCs may not recognize "regedit" or "reagentc" when you run them.

But, like "reagentc.exe",extensionThe command will be recognized if you run it with

command prompt
command prompt

This is because ".EXE" has been removed from the environment variable "PAHTEXT".

It was probably deleted by the person using the PC you purchased.

table of contents

Check the contents of the environment variable "PAHTEXT"

Open a command prompt, type the following command, and then press Enter:

Learn how to open a command prompt

1. Press Windows key + R to open Run.

2. Type "cmd".

Run
Run

3.Shift + Ctrl + Enter Please press.

Keyboard
Keyboard

If you do not need administrator privileges, just press Enter.

4. When the "User Account Control" message appears, click "Yes".

ユーザーアカウント制御
ユーザーアカウント制御
set pathext

The contents of the environment variable "PAHTEXT" will then be displayed, such as "PATHEXT=.COM;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC".

command prompt
command prompt

If you look at the image above, you'll see that ".EXE" is not displayed. (It has been intentionally removed.)

In this state, if you run the commands "regedit" or "reagentc" without an extension, they will not be recognized.

Reset the contents of the environment variable "PAHTEXT" to the default

1. Press Windows key + R to open Run, type "sysdm.cpl" and press Enter.

Run
Run

2. System Properties will open, so open the "Advanced" tab and click the "Environment Variables" button at the bottom.

System Properties
System Properties

3. ①Select "PATHEXT" and ②click "Edit".

environmental variables
environmental variables

4. ① Delete the contents of "Variable Value" and copy and paste the following variable value.

.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC

5. Click OK.

Editing System Variables
Editing System Variables

6. Finally, click OK under "Environment Variables".

*If you exit by clicking the × button without clicking OK here, the changes you made will be reverted.

environmental variables
environmental variables

7. Restart your PC.

The contents of the environment variable "PAHTEXT" have already been reflected, so open the command prompt and check.

You should be able to run "regedit" or "reagentc" without the extension.

command prompt
command prompt
If you found this article helpful, please share it on social media.

Person who wrote this article

Driven by questions arising from my daily PC use and the desire to "do more," I have been pursuing self-study in Windows since around 2008. I am sharing the "aha!" techniques and solutions I discovered through trial and error with the sole purpose of helping you in your PC life.

View profile

Comment:

To comment

[About submissions]
We welcome any questions or information regarding the content of the article.
However, please note that content unrelated to the purpose of the article, criticism of specific individuals or organizations, offensive language,Inappropriate wordsComments containing the above may be deleted or made private without notice at the discretion of the administrator.
Please note that spam may be automatically deleted by anti-spam measures.

CAPTCHA


table of contents