Table of Contents
Wouldn’t it be cool, if we were able to launch an app that was saved in a particular folder in say E:\Apps\myapp.exe drive be runnable even outside that folder or anywhere you want by typing just the exe name and not including the entire path referencing to it.
And anywhere means, you can launch your application
- From Start menu (shortcut – Windows key).
- From Run command dialog box (shortcut – Windows + r).
- By typing application name in Windows Address bar of any drive/ folder on your computer.
- By typing application name from a command prompt opened from any drive/ folder directly without worrying to change the directory.
For demonstration purposes, we have an application with the name myapp. The output path of this application is E:\Apps\myapp.exe.
We will be basically doing two things here to let our computer know about this application.
- Registering the path to exe in the system registry.
- Registering the path to exe in PATH environment variable.
Registering the path to exe in the system registry
1. Type regedit in the search box then open the Registry Editor.
2. Navigate to the following location. You can copy the location then paste into the address bar in the Registry Editor.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
3. Next, right-click on App Paths and create a new key.
4. Enter the name of the key is your app name myapp.exe
5. On the right side, you see the (Default) value name. Let’s double click on it, then enter the path of your app as value data.
6. Now add one more string value, by right on the blank | New | String Value.
7. Name the value Path and set its data value to the exe’s containing folder followed by a semicolon. In my case, it is E:\Apps.
You’re almost done! These above steps will enable your application to be accessible via the Windows Address bar of any drive and folder, start menu, and Run box.
Registering the path to exe in PATH environment variables
Now, perform just this one last step to make your application accessible from any command prompt anywhere.
1. Type env in the search bar then open Edit the system environment variables.
2. In the System Properties window, select Environment Variables… button.
3. In the Environment Variables window, under System variables select Path then click Edit button.
4. Now, click New then enter the folder of your application. In this case, we add E:\Apps. Click Ok twice to save the changes.
That’s it! There you go. You just made your application a global star on your computer. You can call it from anywhere now with just the name.