"Register" an .exe so you can run it from any command line in Windows

You can add the following registry key:

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\myexe.exe

In this key, add the default string value containing the path to the exe file.


You need to make sure that the exe is in a folder that's on the PATH environment variable.

You can do this by either installing it into a folder that's already on the PATH or by adding your folder to the PATH.

You can have your installer do this - but you may need to restart the machine to make sure it gets picked up.


Windows 10, 8.1, 8

Open start menu,

  1. Type Edit environment variables
  2. Open the option Edit the system environment variables
  3. Click Environment variables... button
  4. There you see two boxes, in System Variables box find path variable
  5. Click Edit
  6. a window pops up, click New
  7. Type the Directory path of your .exe or batch file ( Directory means exclude the file name from path)
  8. Click Ok on all open windows and restart your system restart the command prompt.

Tags:

Windows