Jump to content
Sign in to follow this  
Jeffro11821

Scripting IE Settings

Recommended Posts

Jeffro11821

Hello all,

I'm not 'sure' that I'm asking this question in the correct forum, but I'm hoping someone out there has fought a similar problem and can guide me on the best way to accomplish my goal.

I am attempting to automate IE security/script/cookie settings using either VBScript or AuotIT. All of these settings are stored under Tools --> Internet Options --> Security/Privacy tabs

Using VBScript (script included below) I have been able to script a series of registry keys that will take care of 'most' of the changes I need to make. However, I'm down to the scripting of 2 changes that I can't seem to figure out...

1. Enable 'Scripting of Java Applets' (this is under 'Internet Options' -> Security -> trusted sites -> custom level)

2. Always Allow Session cookies (this is in advanced under the privacy tab)

I can't find the registry keys that handle either of these, so I"m having trouble doing this in VBScript. Any suggestions as to how I could/should make these changes using AutoIT?

Thanks

-jeff

'   Download signed ActiveX components from a Web page (Zone 2)
HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objReg = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2"
objReg.CreateKey HKEY_CURRENT_USER, strKeyPath
ValueName = "1001"
dwValue = 0
objReg.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, ValueName, dwValue





'   Download unsigned ActiveX components from a Web page (Zone 2)
HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objReg = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2"
objReg.CreateKey HKEY_CURRENT_USER, strKeyPath
ValueName = "1004"
dwValue = 0
objReg.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, ValueName, dwValue






'   Run ActiveX components and plug-ins from Web pages (Zone 2)
HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objReg = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2"
objReg.CreateKey HKEY_CURRENT_USER, strKeyPath
ValueName = "1200"
dwValue = 0
objReg.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, ValueName, dwValue




'   Allow scripts to interact with ActiveX components marked safe for scripting (Zone 2)
HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objReg = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2"
objReg.CreateKey HKEY_CURRENT_USER, strKeyPath
ValueName = "1405"
dwValue = 0
objReg.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, ValueName, dwValue




'   Run script code on Web pages (Zone 2)
HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objReg = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2"
objReg.CreateKey HKEY_CURRENT_USER, strKeyPath
ValueName = "1400"
dwValue = 0
objReg.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, ValueName, dwValue



'   Disable caching of SSL pages
HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objReg = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings"
objReg.CreateKey HKEY_CURRENT_USER, strKeyPath
ValueName = "DisableCachingOfSSLPages"
dwValue = 0
objReg.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, ValueName, dwValue

Share this post


Link to post
Share on other sites
Jeffro11821

First off, thank you for your time in responding.

I was just reading about the reg read/write commands available... I think those will be useful.

However, while that will help with moving my VBScript stuff into AutoIT

a) I can't find the keys that control my 2 problems children (mentioned in first post)

:) I'm not sure how to automate their (2 items mentioned in first post) settings with AutoIT either

So, basically, I have the registry keys for everything except the 2 items mentioned... that's where I'm stuck. How do I go about configuring those 2 items? I can't find the registry keys like I did the others...

All help is *GREATLY* appreciated.

-jeff

Share this post


Link to post
Share on other sites
PsaltyDS

You might be looking for this: Description of Internet Explorer security zones registry entries

For example, this key enables "Scripting: Scripting of Java applets" for the "Local Intranet Zone":

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\1\1402 = 0

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
Jeffro11821

PsaltyDS:

I haven't had time to read the details of that knowledgebase article 'yet', however... at quick glance it looks very promising!

Thank you for taking the time to share.

-jeff

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×