[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 the 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. It won't take more than 10 seconds of your time. The share buttons are right below. :)

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a consecutive ten-time recipient of the Microsoft Most Valuable Professional award in the Windows Shell/Desktop Experience category, from 2003 to 2012. He loves to troubleshoot and write about Windows. Ramesh founded Winhelponline.com in 2005.

Leave a Comment