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
This is because ".EXE" has been removed from the environment variable "PAHTEXT".
It was probably deleted by the person using the PC you purchased.
Check the contents of the environment variable "PAHTEXT"
Open a command prompt, type the following command, and then press Enter:
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".
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.
2. System Properties will open, so open the "Advanced" tab and click the "Environment Variables" button at the bottom.
3. ①Select "PATHEXT" and ②click "Edit".
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.
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.
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.












Comment: