我想制作一个简单的Windows桌面小部件来打开和closuresInternet代理。
什么是更简单的方法?
您可以使用Visual Basic脚本和批次创建一个简单的“小部件”。
例:
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
说明:
完成! 非常简单而有效。 现在,您可以点击“Proxy.lnk”(桌面上的快捷方式),将您的代理设置为“开”和“关”。
代理关闭
在图标网址: http : //s30.postimg.org/sgoerz0od/image.png
关闭图标网址: http : //s13.postimg.org/9zha38zkj/off.png