Windows desktop widget to turn proxy on and off

后端 未结 2 755
臣服心动
臣服心动 2021-02-06 16:39

I want to make a simple Windows desktop widget to turn on and off the internet proxy.

What is the simpler way?

2条回答
  •  無奈伤痛
    2021-02-06 17:06

    In Windows 10 it seams that after execute the script you need to open proxy settings window for changes to take effect. So add the following lines:

    proxy_off.bat

    echo off
    cls
    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 0 /f
    change_shortcut_on
    start /min ms-settings:network-proxy
    taskkill /IM SystemSettings.exe /f
    exit
    

    proxy_on.bat

    echo off
    cls
    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f
    change_shortcut_off
    start /min ms-settings:network-proxy
    taskkill /IM SystemSettings.exe /f
    exit
    

    ATM the setting window don`t start minimized.

提交回复
热议问题