Desde el trabajo salgo a internet por un proxy, pero desde casa no.
Asi que cada vez que voy y vengo tengo que hacer 8 clicks para cambiar la configuración.
Por fin me he decidido a realizar un script para realizar esta tarea:
El script se basa en los valores del registro para habilitar/deshabilitar la clave "ProxyEnabled"
' Proxy UtilSub changeProxy()
Dim ProxyEnableHive
Dim WsShell
Dim current, newValue
Dim msg, titletitle = "Proxy Enable Util"
ProxyEnableHive = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable"Set WsShell = WScript.CreateObject("WScript.Shell")
current = WsShell.RegRead(ProxyEnableHive)msg = "Proxy is "
if (current=0) Then
newValue = 1
msg = msg & "disabled. "
else
msg = msg & "enabled. "
newValue = 0
end if
msg = msg & vbNewLine & "Do you want to change it?"if (MsgBox(msg,4,title)=6) then
Call WsShell.RegWrite(ProxyEnableHive, newValue, "REG_DWORD")
Call MsgBox ("Proxy Settings Changed",0,title)
End if
WScript.Quit
End SubCall changeProxy()
A ver si os sirve !!
Posted by rido at 30 de Agosto 2003 19:16mira intente lo que acabas de hacer, pero no me funciona. Me tira que el WScript no esta declarado, el tema es qeu yo lo declaro y me tira otro error con que no lo puedo llamar string.. y demas..
Te cuento que acabo de empezar en este mundo del visual y me gustaria seguir aprendiendo..
Posted by: charly anghileri on 18 de Mayo 2010 22:13