Command line to remove an environment variable from the OS level configuration

前端 未结 9 1132
闹比i
闹比i 2020-11-30 17:11

Windows has the setx command:

Description:
    Creates or modifies environment variables in the user or system
    environment.

So you can

9条回答
  •  -上瘾入骨i
    2020-11-30 17:57

    The command in DougWare's answer did not work, but this did:

    reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v FOOBAR /f
    

    The shortcut HKLM can be used for HKEY_LOCAL_MACHINE.

提交回复
热议问题