62

Is there a more direct way to the environmental variables GUI than the following?

  1. Right click 'My Computer' and select 'Properties'.
  2. Click 'Advanced System Settings' link.
  3. Click 'Advanced' tab.
  4. Click 'Environment Variables...' button.

Can I make a shortcut to it?

3
  • 2
    You can always use "set" (without the quotes) from a command prompt to display, set, or remove environment variables. It doesn't get any more direct than that.
    – joeqwerty
    Jan 18, 2012 at 18:19
  • 3
    Using the set command will only alter the copy of the environment local to the current command shell. The environment variables in the GUI will hold for all new shells and environments. Apr 11, 2018 at 0:18
  • Isn't there a shell: shortcut, like for, for example, the Recycle Bin? Dec 29, 2022 at 16:59

4 Answers 4

99

Starting with Windows Vista, the panel can be displayed from the command line (cmd.exe) with a

rundll32 sysdm.cpl,EditEnvironmentVariables

It is from here.

4
  • 1
    beautiful! down with the mouse!
    – chris
    Oct 6, 2017 at 10:45
  • 1
    Even better: run it from PowerShell! Feb 7, 2019 at 20:43
  • 1
    If you want to open the Windows Environment Variables dialog from a launcher application such as SlickRun, you can enter cmd as the command, and /c "start rundll32 sysdm.cpl,EditEnvironmentVariables" as the parameters. This will open cmd.exe, open the Environment Variables dialog, and immediately close the cmd.exe window that was just opened. I have this mapped to the env keyword in SlickRun, so I can quickly view Windows environment variables using the standard Unix env command. (And I have SlickRun run this as admin so I can edit system-level environment variables.) Jun 19, 2019 at 18:58
  • Windows10 Update: If you want to run this command in Windows 10 the syntax has changed just a bit: rundll32.exe sysdm.cpl,EditEnvironmentVariables (courtesy of this site )
    – user513337
    Sep 2, 2022 at 17:28
12

I recommend this: Open the "Run" prompt → type "SystemPropertiesAdvanced". You will be on the Advanced tab of the System Properties window. From here it's easy. I feel this is an easier command to remember than the command prompt's and a good shortcut.

Windows 7: Start menu → in the search bar, type "system variables" and Enter. You will have the Advanced tab of the system properties window open.

Windows 8 and later: Simply type the above in the search box in the task bar.

3
  • 2
    This required Admin access on a peer's computer. The accepted answer did not.
    – Mike
    Oct 10, 2017 at 14:05
  • 1
    It should be the Accepted Answer. Mar 14, 2018 at 4:20
  • 2
    If your logged in account is an Administrator account, you won't have the UAC prompt with this method (on Win 10 20H2). The "rundll32 sysdm.cpl,EditEnvironmentVariables" method won't let you change the system environment variables unless you run it as Administrator which shows an UAC prompt. But you arrive directly on the right window. Feb 17, 2021 at 10:43
5

Open Notepad, copy the below line, and save it as "SysPropAdv.bat". Run in a cmd prompt. It will open a system properties window.

start SystemPropertiesAdvanced.exe

2
  • that is also good but not the great to reached till environment variable . thanks Mar 7, 2017 at 18:35
  • 5
    or in a different way use -> window + r -> and type SystemPropertiesAdvanced.exe -> and just enter, making .bat and finding to file and double click may not be the efficient way. Mar 7, 2017 at 18:37
3

If you want to do it with an administrator's rights (to be able to edit the System Variables):

  • from the "Run" command prompt, use:

    powershell -command "&{start-process rundll32.exe sysdm.cpl,EditEnvironmentVariables -verb RunAs}
    
  • from the cmd shell, use:

    start powershell -command "&{start-process rundll32.exe sysdm.cpl,EditEnvironmentVariables -verb RunAs}"
    
2
  • 1
    On Windows 10 20H2, the SystemPropertiesAdvanced method does not prompt for administrator privileges if your account is an Administrator. Feb 17, 2021 at 10:40
  • You can also add -WindowStyle hidden before -command to minimize the powershell window.
    – MagTun
    Nov 13, 2022 at 17:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .