Is there any easy way or shortcut to set PATH on Windows?

2

I found it's not easy to set PATH on Windows. I need to click many times to find the place.

  1. opening up the system properties (WinKey + Pause)
  2. selecting the “Advanced” tab
  3. click the “Environment Variables” button
  4. then adding or selecting the PATH variable

Look it takes so many clicks. Is there any easy way or shortcut to do this?

I know there are commands for this (https://stackoverflow.com/questions/3036325/can-i-set-an-environment-variable-for-an-application-using-a-shortcut-in-windows) but I can't remember...

Haz Wof

Posted 2019-05-16T13:14:53.307

Reputation: 21

Do you want that path to be visible only for a specific program at runtime? or for all programs all time? – Biswapriyo – 2019-05-16T13:19:38.883

Answers

3

(via How to Set User Environment Variable Using Setx in Windows 10)

To open the Environment Variables dialog directly, create a desktop shortcut to:

rundll32 sysdm.cpl,EditEnvironmentVariables

To alter System variables, the shortcut has to be run elevated.

w32sh

Posted 2019-05-16T13:14:53.307

Reputation: 8 611

2Nice answer! Note that the setx (here in the same post) can be used in a batch file to if you want to automate setting the path to different things. – Señor CMasMas – 2019-06-11T15:07:15.487

2

On Windows 7, you can type "env" into the Start Menu Run dialog and select the first link that appears (Edit environment variables for your account). This will take you directly to the Environment Variables dialog. Unfortunately, you will still have to select the variable(s) to edit manually.

As a small addendum, if you simply type "env" (again, in the Run dialog above) and hit Enter, the Environment Variables dialog box will appear without needing to select the first link.

Anaksunaman

Posted 2019-05-16T13:14:53.307

Reputation: 9 278

2Edit environment variables for your account and Edit the system environment variables are available on Windows 10 – phuclv – 2019-06-11T10:36:30.823

1

Solutions I use:

  • Typing systempropertiesadvanced Enter into the Start menu to avoid some clicks
  • Using Rapid Environment Editor (3rd party software)

gronostaj

Posted 2019-05-16T13:14:53.307

Reputation: 33 047

1You can also type it into a run box (Win+R) and it will open it directly. – Moab – 2019-05-16T16:03:22.953

1@Moab Typing directly into Start menu is one keystroke quicker, just Win instead of Win+R ;) – gronostaj – 2019-05-16T18:05:24.420

Thanks. But typing so many characters is another even more "clicks"... – Haz Wof – 2019-05-23T04:25:11.220

@HazWof Then go for option 2. It's not available out if the box, but gets the job done. – gronostaj – 2019-05-23T05:04:14.003

@SeñorCMasMas Interesting, I didn't know that one. I've removed misleading information. Saying that the answer was "plain wrong" in an unjustified exagerration IMO, it still provided useful approaches to this problem. I also don't think that it's "obvious" that you can open that window directly, w32sh's command is far from obvious. – gronostaj – 2019-06-12T06:04:22.267

Sorry @gronostaj, You are absolutely right about the tone of my statement. My comment was out of line so I deleted it. I thank you for your service to this community and didn't mean to be a ****. – Señor CMasMas – 2019-06-12T15:31:17.147

-2

I used to just winkey+r then set PATH=C:\wherever\

Can't remember if it uses quotes only on spaces or all the time.. I used to have to use this with adb.exe

Gnome9er

Posted 2019-05-16T13:14:53.307

Reputation: 1

5I have no idea how you had any success with this. This will do absolutely nothing. – Señor CMasMas – 2019-06-11T15:10:01.710