Colaboraciones en el Guille

Cambiar el Proxy de IE utilizando VB

 

Fecha: 04/Oct/2005 (29 de Septiembre de 2005)
Autor: Autor: Bruno Capuano - bcapuano@gmail.com 

 


Introducción

A menudo cuando trabajamos en diferentes entornos, necesitamos tener configuradas diferentes configuraciones para la pc/notebook para cada uno de ellos. Una de las cosas que siempre tenemos que cambiar es el proxy, y este es un trabajo bastante pesado, ya que son varios pasos en el Internet Explorer. Es por eso que cree varios archivos VbScript que permiten realizar esta tarea.

Scripting - VB

Por ejemplo, en el primero de ellos, muestro como configurar el IE para que utilice el proxy "MyProxyServer", en puerto 80.

' =============================================

' Autor : Bruno Capuano

' Fecha : 29-09-2005

' =============================================

 

dim strProxyServer

 

' define el proxy y el puerto si es necesario

strProxyServer = "MyProxyServer:80"

 

' ubicacion en la registry

dim strRegPath

strRegPath = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\"

Set oWshShell = CreateObject("WScript.Shell")

 

' modifica las entradas en el registro

Call oWshShell.RegWrite(strRegPath & "ProxyEnable", "00000001", "REG_DWORD")

Call oWshShell.RegWrite(strRegPath & "ProxyOverride", "<local>", "REG_SZ")

Call oWshShell.RegWrite(strRegPath & "ProxyServer", strProxyServer, "REG_SZ")

      

' notificacion

Msgbox "Proxy setting enabled. " & VbCrLf & "Server - " & strProxyServer

 

' destroy   

Set oWshShell = Nothing

El segundo script, muestra como deshabilitar el uso del Proxy para el IE.

' =============================================

' Autor : Bruno Capuano

' Fecha : 29-09-2005

' =============================================

 

dim strRegPath

 

' ubicacion en la registry

strRegPath = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\"

Set oWshShell = CreateObject("WScript.Shell")

 

' modifica las entradas en el registro

Call oWshShell.RegWrite(strRegPath & "ProxyEnable", "00000000", "REG_DWORD")

 

' notificacion     

Msgbox "Proxy setting disabled"

 

' destroy

Set oWshShell = Nothing

 

Espero que les sea útil y ante cualquier duda, pueden escribirme a  bcapuano@gmail.com

Saludos

El Bruno

http://spaces.msn.com/members/brunocapuano.

 


ir al índice principal del Guille