Sometimes when you do many installations on your Windows, you need to specify the path manually. Instead of manually doing that, you can create a shortcut to “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 that 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 properly used, 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 try to find the executable we are trying to run.
If you don’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 a path to the context menu, it is important to know the concept of environment variables. Environment variables are the variables that tell the environment in which the programs run. They can tell you where your Windows Operating System is installed or what your current working directory is. Where are the 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 store the information the same to all user accounts. The information related to your system is not related to any specific user, like where your Windows or system path is installed.
Path is also an environment variable, which comes under both system and user environment variables. Some programs require you to know the path of the specific program. You don’t need to add the path in most cases. The system or user software does that automatically. However, sometimes you are required to explicitly mention the path in the environment variables.
Add to Path to Context menu
You can add the “Add to path” option in the menu using the following method.
- Download the pathed tool, which is part of gtools from the link.
- Extract the file in the folder you have downloaded it.
- Now download this AddCurrentFoldertoPathVariable.zip and extract it from 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, 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 to the registry file, you can add a path through the command line. Though this is quick, you have to add a path for each installation separately.
To add a path through the 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 manually add the path, otherwise your operating system will not work properly, and it can lead to error if you changed any system or user variable path mistakenly. In such cases, this add to path variable in the context menu and can be handy. It’s up to you whether you want to install the software to add the variable to the context menu or if you want to add it using the command prompt.