How do I execute .exe files without typing the extension?

John Savill

July 30, 2001

1 Min Read
ITPro Today logo in a gray background | ITPro Today

A. Your computer knows the common extensions via the pathext environment variable. To view the extensions, go to a command prompt and type:

C:>set pathext

When you type in this environment variable, you'll see a list of extensions that your computer recognizes, similar to the following:

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

If your list doesn't look like this example, go to the command prompt and type:

set pathext=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH

You can also set this variable for all users on your machine by editing the registry:

  1. Start the registry editor (regedit.exe).

  2. Go to HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession ManagerEnvironment.

  3. Double-click PATHEXT.

  4. Modify the entry as required (ensure .EXE is present) and click OK.

  5. Close the registry editor.

You can also add new file extensions here so that you can execute those file types without having to type in the file extension.

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like