"Register" an .exe so you can run it from any command line in Windows
How can you make a .exe file accessible from any location in the Windows command window? Is there some registry entry that has to be entered?
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
You can have your installer do this - but you will need to restart the machine to make sure it gets picked up.
Read more... Read less...
You can add the following registry key:
In this key, add the default string value containing the path to the exe file.
Windows 10, 8.1, 8
Open start menu,
Edit environment variables
- Open the option
Edit the system environment variables
- There you see two boxes, in
System Variablesbox find
- a window pops up, click
- Type the Directory path of your
batchfile ( Directory means exclude the file name from path)
Okon all open windows and
restart your systemrestart the command prompt.
You have to put your
.exe file's path into enviroment variable path. Go to "My computer -> properties -> advanced -> environment variables -> Path" and edit path by adding
.exe's directory into path.
Another solution I personally prefer is using RapidEE for a smoother variable editing.
Rather than putting the executable into a directory on the path, you should create a batch file in a directory on the path that launches the program. This way you don't separate the executable from its supporting files, and you don't add other stuff in the same directory to the path unintentionally.
Such batch file can look like this:
@echo off start "" "C:\Program Files (x86)\Software\software.exe" %*
it's amazing there's no simple solution for such a simple task on windows, I created this little cmd script that you can use to define aliases on windows (instructions are at the file header itself):
this is pretty much the same approach used by tools like NPM or ruby gems to register global commands.