If you’re unable to launch programs without having to type the extension “.exe” in a Command Prompt window, you need to fix your PATHEXT variable.
For instance, Notepad may launch correctly when you type Notepad.exe, but not when typing Notepad. The latter might show you the following error:
‘notepad’ is not recognized as an internal or external command,
operable program or batch file.
This happens if .EXE is missing in the PATHEXT variable. Use these steps to fix the problem
Reset PATHEXT variable
Press WinKey + R, type
Click Environment Variables, and double-click PATHEXT
Set the PATHEXT value as follows:
Quick Tip #1
To add additional extensions there, such as .PL, add a semi-colon (separator) and then followed by the file extension. Such as:
Quick Tip #2
When you run a command or program without mentioning the extension, Command Prompt uses the value of PATHEXT variable to determine which extensions to look for and in what order.
If you have two files named “test.bat” and “test.vbs” in a folder, running “test” from a Command Prompt window would launch “test.bat”, because .BAT appears at the beginning of PATHEXT variable. By moving .VBS to the front (after .EXE), you can make Command Prompt to launch “test.vbs” instead of “test.bat”. However it’s advisable to use the default order unless you have some special requirements.
One small request: If you liked this post, please share this?One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
- Pin it!
- Share it to your favorite blog + Facebook, Reddit
- Tweet it!
About the author
Ramesh Srinivasan founded Winhelponline.com back in 2005. He is passionate about Microsoft technologies and has a vast experience in Windows — delivering support for Microsoft's consumer products. He has been a Microsoft MVP (2003-2012) who contributes to various Windows support forums.