公告
财富商城
积分规则
提问
发文
2019-04-02 03:00发布
叼着烟拽天下
I want to make a simple Windows desktop widget to turn on and off the internet proxy.
What is the simpler way?
You can create a simple "widget" using Visual Basic scripts and batchs.
Example:
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 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 exit
change_shortcut_off.vbs
Set sh = CreateObject("WScript.Shell") Set shortcut = sh.CreateShortcut("C:\Users\%USERNAME%\Desktop\Proxy.lnk") shortcut.TargetPath = "C:\Users\%USERNAME%\Proxy Settings\proxy_off.bat" shortcut.IconLocation = "C:\Users\%USERNAME%\Proxy Settings\Icons\on.ico" shortcut.Save
change_shortcut_on.vbs
Set sh = CreateObject("WScript.Shell") Set shortcut = sh.CreateShortcut("C:\Users\%USERNAME%\Desktop\Proxy.lnk") shortcut.TargetPath = "C:\Users\%USERNAME%\Proxy Settings\proxy_on.bat" shortcut.IconLocation = "C:\Users\%USERNAME%\Proxy Settings\Icons\off.ico" shortcut.Save
Instructions:
Done! Very simple and effective. Now you can click on "Proxy.lnk" (the shortcut in your Desktop) to turn your proxy "On" and "Off".
Proxy On Proxy Off
On icon url: http://s30.postimg.org/sgoerz0od/image.png Off icon url: http://s13.postimg.org/9zha38zkj/off.png
最多设置5个标签!
You can create a simple "widget" using Visual Basic scripts and batchs.
Example:
proxy_off.bat
proxy_on.bat
change_shortcut_off.vbs
change_shortcut_on.vbs
Instructions:
Done! Very simple and effective. Now you can click on "Proxy.lnk" (the shortcut in your Desktop) to turn your proxy "On" and "Off".
Proxy On Proxy Off
On icon url: http://s30.postimg.org/sgoerz0od/image.png
Off icon url: http://s13.postimg.org/9zha38zkj/off.png