Jump to content

How to change IE options?


Recommended Posts

Hi,

I use a script that needs to put the IE security level to high and deactivate the images.

I do it manually,but i's boring all the time,so I ask you how to make a script to do this?

Or just say where in the register are stocked these information,thanx.

Link to comment
Share on other sites

You could make a script that runs

Run('control inetcpl.cpl')oÝ÷ ٩ݶ§ë-vºw!¡ð¨ÚèÉbrK0)^¶°whÂ+^­% 1¯*.r¥vëÂ)âë_ºw-춶Ø^¢b¢{¢¼¨¸Z%-륨¶^¨ºêå

I have not tested this and I am pretty new to DllCall. I *think* that setting things to 0 would simulate a NULL call.

Edited by ParoXsitiC
Link to comment
Share on other sites

Using http://support.microsoft.com/kb/182569/

$LocalIntranet = 1
$TrustedSites = 2
$Internet = 3
$RestrictedSites = 4

$Low = 0x00010000
$MediumLow = 0x00010500
$Medium = 0x00011000
$High = 0x00012000

$ZonesKey = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\"
RegWrite($ZonesKey & $LocalIntranet, "CurrentLevel", "REG_DWORD", $High)
RegWrite($ZonesKey & $TrustedSites, "CurrentLevel", "REG_DWORD", $High)
RegWrite($ZonesKey & $Internet, "CurrentLevel", "REG_DWORD", $High)
RegWrite($ZonesKey & $RestrictedSites, "CurrentLevel", "REG_DWORD", $High)


;Don't Show Pictures
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Display Inline Images", "REG_SZ", "no")


;Show Pictures
;RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Display Inline Images", "REG_SZ", "yes")


DllCall('WININET.DLL', 'long', 'InternetSetOption', 'int', 0, 'long', 39, 'str', 0, 'long', 0)

This will set all zones to high security and it wont display pictures. Calling the DllCall will update the all instances of IE to those settings. Without it you won't see a change until you restart IE.

Edited by ParoXsitiC
Link to comment
Share on other sites

This is good stuff.

Did you try passing an HWND into the DllCall to get it to activate for a single IE instance as well?

I'd love to see you break this down into unigue examples for images and security level and enter them into the snippets database

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Dale,

You cannot use a hwnd in the InternetSetOption function because this function relies on handles from wininet functions such as InternetOpen, InternetConnect.

It is true that Internet Explorer does use the wininet but each instance of an IE thread can run off the same wininet InternetOpen handle. Therefore you can only update all at once. I wish there was a way to only update a IE thread but to my knowledge you can not. However users could be able to call certain internet options if they used the InetGet functions and such.

http://msdn.microsoft.com/library/default....net_options.asp

Link to comment
Share on other sites

  • 4 years later...

What If I simply want to reset the security for all zones to default?

Using http://support.microsoft.com/kb/182569/

$LocalIntranet = 1
$TrustedSites = 2
$Internet = 3
$RestrictedSites = 4

$Low = 0x00010000
$MediumLow = 0x00010500
$Medium = 0x00011000
$High = 0x00012000

$ZonesKey = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\"
RegWrite($ZonesKey & $LocalIntranet, "CurrentLevel", "REG_DWORD", $High)
RegWrite($ZonesKey & $TrustedSites, "CurrentLevel", "REG_DWORD", $High)
RegWrite($ZonesKey & $Internet, "CurrentLevel", "REG_DWORD", $High)
RegWrite($ZonesKey & $RestrictedSites, "CurrentLevel", "REG_DWORD", $High)


;Don't Show Pictures
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Display Inline Images", "REG_SZ", "no")


;Show Pictures
;RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Display Inline Images", "REG_SZ", "yes")


DllCall('WININET.DLL', 'long', 'InternetSetOption', 'int', 0, 'long', 39, 'str', 0, 'long', 0)

This will set all zones to high security and it wont display pictures. Calling the DllCall will update the all instances of IE to those settings. Without it you won't see a change until you restart IE.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...