is it possible to change the security options of Internet Explorer by a
VBScript?
I usually run the IE with security level set to high in the Internet Zone
but some sites require medium level. My preferred solution would be to make
the change via a button within the IE itself.
Any ideas?
Ingo
Not possible. If client side script could change client side security, what
would be the point of client side security?
--
Michael Harris
Microsoft.MVP.Scripting
Windows 2000 Scripting Guide
Microsoft® Windows®2000 Scripting Guide
http://www.microsoft.com/technet/scriptcenter/scrguide/sagsas_overview.asp
TechNet Script Center Sample Scripts
http://www.microsoft.com/downloads/release.asp?ReleaseID=38942
WSH 5.6 documentation download
http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-8A76-1C4099D7BBB9&displaylang=en
Hi,
"If client side script could change client side security, what
would be the point of client side security"
- Michael Harris (MVP), 2003
Priceless!
IE "security settings" are stored in the registry under this key:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\
and under the appropriate \zones\ subkey in HLKM and HKCU
This code was designed for something similar. It should show you the path.
you could add a shortcut in IE's right-click menu, or bookmark it
Let me know if you want to alter Office security settings as well ;-)
'VB Script to change IE security settings
Option Explicit
Const MY_COMPUTER_ZONE = 0
Const LOCAL_INTRANET_ZONE = 1
Const TRUSTED_ZONE = 2
Const INTERNET_ZONE = 3
Const RESTRICTED_ZONE = 4
Dim WSHShell
Dim a,b,c,i,z
Dim reg(1)
' These key names contain the permissions to want to set
' Look in the registry to get the right key names
reg(0) = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\" _
& "SO\COOKIE\CookiePersistent\Query\"
reg(1) = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\" _
& "SO\COOKIE\CookieSession\Allow\"
Set WSHShell = WScript.CreateObject("WScript.Shell")
' looping through the array of keys:
For i = LBound(reg) To UBound(reg)
' these tell you what to write:
a = WSHShell.RegRead(reg(i) & "RegPath")
b = WSHShell.RegRead(reg(i) & "ValueName")
c = WSHShell.RegRead(reg(i) & "CheckedValue")
' For z = 0 To 4 ' use a loop here to write to each zone
z = INTERNET_ZONE
' write the key
WSHShell.RegWrite "HKCU\" & Replace(a, "%s", z) & "\" & b, _
c, "REG_DWORD"
' Next
Next
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
> <snip>
> And try running this code in a non-hta web-page ...
>
Who said anything about a web page?
Ummm - Michael Harris did?
I focussed on client-side code since you seemed so intent on denigrating
Michael's completely factual statement. Ok, so his reply did not really
address the question asked by the original poster, but... haven't you ever
misread a question on these newsgroups?
It will work if it is run in the context of "My Computer" with the right
permission
i.e. any page on the local filesystem.
A bookmarked page called "c:\Adjust Security.htm" perhaps?
You would need to remove the wscript. from this line:
WScript.CreateObject("WScript.Shell")
and put html and script tags around the code
No he didn't!
>
> I focussed on client-side code since you seemed so intent on denigrating
> Michael's completely factual statement. Ok, so his reply did not really
> address the question asked by the original poster, but... haven't you ever
> misread a question on these newsgroups?
>
> Bob Barrows
>
OK, a bit harsh since I think I know exactly what he thinks he read and what he
thinks he means, and for sure what you mean, but it was such a peach of a reply,
in totally the wrong context, and said with such definitive authority. It was
asking for it!
To quote the OP...
"...My preferred solution would be to make
the change via a button within the IE itself...."
My apologies for overreacting last night.
When you change security level it copies the relevant settings
from HKLM\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\TemplatePolicies
into the key above.
You can also customize what medium and high settings actually
are by modifying the relevant TemplatePolicies settings. The setting
values are just numbers, like "1201", but Microsoft has online docs
that detail what the various settings connect to. (For instance,
if you're going to use IE and go to the trouble to change security
settings back and forth, then you may as well actually make high
security high by disabling things like Java and ActiveX in the
TemplatePolicies\High key.)
The only problem with changing levels via script is
that it won't take until you close and re-open IE. So it's
really no easier than going through the IE menu.
--
--
Ingo Streek <In...@Streek.de> wrote in message news:bqd4q3$n2l$1...@online.de...
thanks a lot, this will help a great deal. If any further problems arise, I
will contact you.
Ingo
"Tom Brown" <no.e...@no.email> schrieb im Newsbeitrag
news:bqdnpd$pe2$1...@sparta.btinternet.com...