Sometimes when you do many installations on your Windows you need to specify the path each time manually. Instead of doing that manually you can create a shortcut of “Add to Path” in the context menu. In this article the method of adding path to context menu will be explained.
Path is an environment variable which specifies the set of directories where executable programs are located. Every executing path has its own PATH string. The commonly used programs can run easily using the PATH command . But if it is not used properly it can even slow down the performance of your computer. When we run a program without specifying the complete path, Windows will look in the paths given in the PATH variable and will try to find the executable we are trying to run.
If it doesn’t find the complete application path from there, it will give an error that it is not recognized as an internal or external command, operable program or batch file. Either we will need to specify the full path of the program or we can add the folder where this program is located to the PATH variable.
Before adding path to the context menu, it is important to know the concept of environment variables. Environment variables are the variables which tells the environment in which the programs run. They can tell you where is you window installed or what is your current working directory? where are temporary files installed?.
Each environment variable contains a variable name and its value. There are two types of variables.
- System variables
- User variables
User variables contain information specific to the user account like your user profile information and the temporary files installed on your account while the system variables stores the information same to all user accounts i-e the information related to your system not related to any specific user like where is your windows or system path installed.
Path is also an environment variable which comes under both system and user environment variables. Some programs require to know the path of the specific program. You need not to add the path in most cases . The system or user software do that automatically. However, sometimes you require to explicitly mention the path in the environment variables.
You can add “Add to path” option in the menu using the following method.
- Download the pathed tool which is a part of gtools from the link.
- Extract the file in the folder you have downloaded it.
- Now download this AddCurrentFoldertoPathVariable.zip and extract it in the folder. It contains 2 registry files i-e AddPathEntries.reg and RemovePathEntries.reg.
- If you have extracted the pathed in the same folder as it was downloaded then double click AddPathEntries.reg and accept the window prompt and your key values will be successfully added to the registry editor.
- If you have extracted it in another folder, right-click the AddPathEntries.reg file and select Edit to open it in any editor.
- You will see the folder in which you have extracted the files twice for example i have extracted it in C:\Users\User \GTools\\pathed.exe . Change the path to your correct path in both lines.
- Save the file and double click it and then you are done with that.
Add to Path through Command Line
Alternatively, if you do not want to install any tool or add anything in the registry file you can add path through command line. Though this is quick but you have to add path for each installation separately.
In order to add path through command line, open command prompt and type the following command
setx path “%path%;c:\DirectoryPath”
For example , if you want to add c:\Users\yourusername to the path variable type the following command
setx path “%path%;c:\Users\YourUsername”
The path variable is mostly managed in the background and the system and user software take care of it but for some programs or software you have to add the path manually otherwise your operating system will not work properly and it can result in error if you changed any system or user variable path mistakenly. In such cases, this add to path variable in the context menu can be quite handy. It’s up to you whether you wan to install a software to add the variable in the context menu or you want to add it using command prompt.