Adding PATH via Control Panel
- Open ” System Properties “. To open it, click the Start button and in the search box type “view advanced system settings”. Then open the application.
- In the “System Properties” window, click the “Advanced” tab. And at the bottom of the window, click the “Environment Variables” button.
- In the “Environment Variables” window, you will see two types of variables. At the top are “User variables”. If you add PATH to this section, the variable only applies to the current user. Meanwhile, if you add PATH at the bottom, “System variables”, the variables will apply to all users. Select “PATH” and then click the “Edit” button.
- Next, click the “Browse” button and navigate to the directory the executable (exe) file is located. Then click the “OK” button and click all the “OK” buttons again to add the directory.
Adding PATH to a batch file
This option only affects your current shell session, not the entire system. Run this command in the command window you have opened or add it to the batch file you created.
Adding PATH via CMD
Add directory to PATH User variables :
setx path "%PATH%;C:\path\to\directory\"
Add directory to PATH System variables :
setx /M path "%PATH%;C:\path\to\directory\"