Install | Exchange | Vbscript | Windows

Easy Internet Explorer Proxy Changer

by Installer on Jan.22, 2010, under Internet Explorer

Easy IE Easy Changer.
Notes:
Windows XP : Test Completed Success
Windows 7 : Not Working

The Script

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
' *  VBScript to change the IE Proxy Server, by directly editing the registry
' *  Version:  2.1.1
' * Edit From Nick Drosinis
' * Change Log:
' *
' * Added:
' * Inputbox for Proxy Address
' * Check Current Proxy Settings
' *
' *  Enjoy!

'Option Explicit

' *  Proxy Server

dim strComputer
strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2\Applications\MicrosoftIE")
'Display Proxy settings og Internet Explorer
Set colIESettings = objWMIService.ExecQuery ("Select * from MicrosoftIE_LANSettings")
For Each strIESetting In colIESettings

ProxyServer = ""& strIESetting.ProxyServer&""
Next

wscript.echo "Current Internet Explorer Proxy:" & ProxyServer

Dim proxy

Do
proxy = inputbox("Please enter the new proxy address (ex:192.168.10.10:8080)", "Input")
loop until proxy > ""

' *  Application Title

Dim Title
Title = "Los Proxy Changer"

' *  Welcome Message

Dim Welcome_Text
Welcome_Text = "Do you really want to change the Proxy Server to " & proxy & "?"

Call Welcome()

Sub Welcome()
Dim GO
GO = MsgBox(Welcome_Text, 36, Title)
If GO = 7 Then
WScript.Quit
End If
End Sub

' *  Warning Message

Dim Warning_Text
Warning_Text = "Warning:  All current Internet Explorer and Windows Explorer windows will be closed." & Chr(10) _
& Chr(10) _
& "Do you still wish to continue?"

Call Warning()

Sub Warning()
Dim GO
GO = MsgBox(Warning_Text, 36, Title)
If GO = 7 Then
WScript.Quit
End If
End Sub

' *  WSHShell

Dim WSHShell
Set WSHShell = WScript.CreateObject("WScript.Shell")

' *  Kill IE (and consequently WE as well)

Call Kill_IE()

Sub Kill_IE()
While WSHShell.AppActivate("Internet Explorer")
WSHShell.SendKeys "%{F4}"
WScript.Sleep 500    ' Impedes a traffic jam
WEnd
End Sub

' *  Regedits

WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 1, "REG_DWORD"
WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer", proxy
WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyOverride", ""
WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\DisablePasswordCaching", 1, "REG_DWORD"

' *  Confirmation

Dim confirm
confirm = MsgBox("Proxy Server has been changed to " & proxy & ".  Enjoy.", 64, Title)

' *  Open IE

WSHShell.run "iexplore.exe http://www.install.gr"

Related posts

:, ,

1 Trackback or Pingback for this entry

  • to domain name

    hi guys…

    hi guysI would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well and i have start my own blog now, , thanks for your effort…

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

    Archives

    All entries, chronologically...