- 1 year ago
Adding directory and subdirectories to Path variable
Comment
1 / 1
To add a directory and its subdirectories to the PATH
environment variable on Windows, you can follow these steps:
Open System Properties:
- Press the
Windows + Pause
key combination to open the System Properties window. - Click on the "Advanced system settings" link on the left.
- Press the
Environment Variables:
- In the System Properties window, click the "Environment Variables..." button.
Edit User or System Variables:
- Under the "Environment Variables" window, you'll see two sections: User variables and System variables.
- Choose either the "User variables" section (for your user account only) or the "System variables" section (for all users on the computer).
- Select the
PATH
variable and click the "Edit" button.
Add New Path Entry:
- In the "Edit Environment Variable" window, click the "New" button.
- Enter the full path of the directory you want to add. Make sure you include the directory's main path as well as its subdirectories.
- Click "OK" to close the windows.
Close All Windows:
- Click "OK" on the remaining windows to close them.
Restart Command Prompt:
- If you have any Command Prompt windows open, close and reopen them to apply the changes.
- Alternatively, you can restart your computer to ensure the changes take effect for all applications.
After performing these steps, the directory and its subdirectories will be added to the PATH
environment variable. This allows you to run commands from any location on the command line without specifying the full path to the executable.
Please note that modifying the PATH
environment variable can affect how your system and applications behave. Be cautious when adding or modifying paths, and make sure you're adding trusted directories.