DEV Community

Dennis Zhang
Dennis Zhang

Posted on • Updated on

windows设置系统变量

PowerShell中

# 删除,临时
Remove-Item Env:HTTP_PROXY
# 设置
$env:HTTP_PROXY = "http://my-company-proxy.com"
# 保存和新会话 save and use your proxy for all new shells
setx HTTP_PROXY http://my-company-proxy.com
// 去除代理
setx HTTP_PROXY " "

#查看
$env:HTTP_PROXY
// 永久,需要权限
[System.Environment]::SetEnvironmentVariable("HTTP_PROXY", $null, "User")
// Windows PowerShell:

[System.Environment]::SetEnvironmentVariable("HTTP_PROXY", $null, "User")
[System.Environment]::SetEnvironmentVariable("HTTPS_PROXY", $null, "User")

// Command Prompt:
set HTTP_PROXY=
set HTTPS_PROXY=

Enter fullscreen mode Exit fullscreen mode

Top comments (0)