Usuário com melhor resposta
SCRIPT .BAT PARA HABILITAR E DESABILITAR PROXY

Pergunta
-
Bom dia!
Alguém tem um script .bat que habilite e desabilite um endereço de proxy no IE?
Estou precisando muito. Tenho vários usuários com notebooks que precisam utilizar o proxy dentro da empresa, mas fora não. Daí ficam me ligando direto para orientar como desabilitar e habilitar.
Aguardo.
Johhanes
Johhanes
Respostas
-
Ja que esta area é de scripts.. ai vai um VBS melhorado para isso..em configproxy coloque seu proxy.. e pronto.
dim oShellset oShell = Wscript.CreateObject("Wscript.Shell")configproxy = "10.10.10.10:8080"if msgbox("Habilitar Proxy?", vbQuestion or vbYesNo) = vbYes thenoShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 1, "REG_DWORD"oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer", configproxy, "REG_SZ"elseoShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 0, "REG_DWORD"end ifSet oShell = Nothing------Eduardo Trombini
Eduardo Trombini MCTS - 2008 network infraestructure MCP - 2003- Sugerido como Resposta Elias Bottega quarta-feira, 6 de outubro de 2010 14:37
- Marcado como Resposta Fábio JrModerator sexta-feira, 2 de dezembro de 2011 12:34
Todas as Respostas
-
Olá,
Você pode fazer por GPO: User Configuration -> Windows Settings ->Internet Explorer Maintenance -> Connection -> Proxy Settings
OU pelo dhcp: http://technet.microsoft.com/en-us/library/cc985352.aspx
Ou por vbs:
http://www.visualbasicscript.com/m_26837/tm.htm
Até mais,
Jesiel
Obs.: Se útil, classifique -
Faz 2 .batHabilita_proxy.batREG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 0x00000001 /fDesabilita_proxy.batREG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 0x00000000 /fveja se ajuda, qualquer duvida poste denovoabs
Eduardo Trombini MCTS - 2008 network infraestructure MCP - 2003 -
-
Ja que esta area é de scripts.. ai vai um VBS melhorado para isso..em configproxy coloque seu proxy.. e pronto.
dim oShellset oShell = Wscript.CreateObject("Wscript.Shell")configproxy = "10.10.10.10:8080"if msgbox("Habilitar Proxy?", vbQuestion or vbYesNo) = vbYes thenoShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 1, "REG_DWORD"oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer", configproxy, "REG_SZ"elseoShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 0, "REG_DWORD"end ifSet oShell = Nothing------Eduardo Trombini
Eduardo Trombini MCTS - 2008 network infraestructure MCP - 2003- Sugerido como Resposta Elias Bottega quarta-feira, 6 de outubro de 2010 14:37
- Marcado como Resposta Fábio JrModerator sexta-feira, 2 de dezembro de 2011 12:34
-
-
-
-
-
mano seria assim!
dim oShell
set oShell = Wscript.CreateObject("Wscript.Shell")
if msgbox("Habilitar Proxy?", vbQuestion or vbYesNo) = vbYes then
oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 1, "REG_DWORD"
oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\AutoDetect", 0, "REG_DWORD"
oShell.RegWrite "HKCU\Software\Microsoft\Windows\currentVersion\Internet Settings\ProxyServer", "127.0.0.1:80", "REG_SZ"
else
oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 0, "REG_DWORD"
oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\AutoDetect", 1, "REG_DWORD"
End if
Set oShell = Nothing -
-
Segue completo, inclusive para desabilitar o script automático:
dim oShell
set oShell = Wscript.CreateObject("Wscript.Shell")
if msgbox("Habilitar Proxy?", vbQuestion or vbYesNo) = vbYes then
oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 1, "REG_DWORD"
oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\AutoDetect", 0, "REG_DWORD"
oShell.RegWrite "HKCU\Software\Microsoft\Windows\currentVersion\Internet Settings\ProxyServer", "proxyws.vigor.local:8080", "REG_SZ"
else
oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 0, "REG_DWORD"
oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\AutoDetect", 1, "REG_DWORD"
oShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\AutoConfigURL", "", "REG_SZ"
End if
Set oShell = NothingOBS: LEMBRANDO QUE PRA DESABILITAR O SCRIPT AUTOMÁTICO, É NECESSÁRIO DESABILITAR QUALQUER SOFTWARE QUE ESTEJA NA MÁQUINA SETANDO O MESMO.