[Fix] Cannot Run Programs Without Typing the Extension (.EXE) in Command Prompt

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.

cannot run programs without typing .exe extension pathext

This happens if .EXE is missing in the PATHEXT variable. Use these steps to fix the problem

Reset PATHEXT variable

Press WinKey + R, type SystemPropertiesAdvanced.exe and press ENTER

Click Environment Variables, and double-click PATHEXT



Set the PATHEXT value as follows:

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

cannot run programs without typing .exe extension pathext

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:

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

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!
So thank you so much for your support, my reader. It won't take more than 10 seconds of your time. The share buttons are right here. :)

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.

Leave a Comment