Of the IE options this one was the hardest and there still is no easy way to do it.

Until now we have been using DWORD, REG_SZ and REG_BINARY keys but with simple values, and for every site you create one key.

Compatibility View Menu

The path in registry starts on HKEY_CURRENT_USER

strPath = "Software\Microsoft\Internet Explorer\BrowserEmulation\ClearableListData"

In Compatibility View we only have one key for every site, it's a REG_BINARY with a string with all sites you insert.

REG_BINARY C. View

So for this we will always have to enter the first values in a computer, read the registry and get the hex values.

Then we have to split the values with commas like this:

strHexValue = "41,1F,00,00,53,08,AD,BA,02,00,00,00,6C,00,00,00,01,00,00,00,02,00,00,00,0C,00,00,00,B8,17,0B,96,3A,52,D5,01,01,00,00,00,0F,00,31,00,39,00,32,00,2E,00,31,00,36,00,38,00,2E,00,31,00,30,00,30,00,2E,00,31,00,30,00,30,00,0C,00,00,00,6A,84,79,9B,3A,52,D5,01,01,00,00,00,0F,00,31,00,39,00,32,00,2E,00,31,00,36,00,38,00,2E,00,31,00,30,00,30,00,2E,00,31,00,30,00,31,00"

And at last we write the value to the key

arrValue = Split(strHexValue, ",")
	ReDim uBinary(UBound(arrValue))
		For i = LBound(arrValue) To UBound(arrValue)
			uBinary(i) = CLng("&h" & arrValue(i))
	Next

	Const HKEY_CURRENT_USER = &H80000001
	Set objRegistry = GetObject("Winmgmts:root\default:StdRegProv")
		strPath = "Software\Microsoft\Internet Explorer\BrowserEmulation\ClearableListData"
		strValueToWrite = "UserFilter"
		objRegistry.CreateKey HKEY_CURRENT_USER, strPath
	intReturn = objRegistry.SetBinaryValue(HKEY_CURRENT_USER, strPath, strValueToWrite, uBinary)

Script IE Exceptions + Compatibility View

Exception "192.168.100.100" 
Exception "192.168.100.101"


Function Exception(Site) 

    Set WshShell = Wscript.CreateObject("Wscript.Shell") 
	
	'------Trusted Sites------' 
	
    strRegKey = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Ranges\" 
		WshShell.RegWrite strRegKey & Site & "\" ,"" , "REG_SZ"
		WshShell.RegWrite strRegKey & Site & "\" & ":Range" , Site, "REG_SZ" 
		WshShell.RegWrite strRegKey & Site & "\*", "2", "REG_DWORD" 
		
		'------Privacy::Sites------' 
	
	strRegKey = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\P3P\History\" 
   
		WshShell.RegWrite strRegKey & Site & "\", 1, "REG_DWORD" 
		
		'------Privacy::Pop-up Blocker------'
	
	strRegKey = "HKCU\Software\Microsoft\Internet Explorer\New Windows\Allow\"
	
		WshShell.RegWrite strRegKey & Site, 0, "REG_BINARY"
		
		'------SSL/TLS------'
	
	strRegKey = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\SecureProtocols"
	
		WshShell.RegWrite strRegKey, 2730, "REG_DWORD"
	
'------Compatibility View------'

		strHexValue = "41,1F,00,00,53,08,AD,BA,02,00,00,00,6C,00,00,00,01,00,00,00,02,00,00,00,0C,00,00,00,B8,17,0B,96,3A,52,D5,01,01,00,00,00,0F,00,31,00,39,00,32,00,2E,00,31,00,36,00,38,00,2E,00,31,00,30,00,30,00,2E,00,31,00,30,00,30,00,0C,00,00,00,6A,84,79,9B,3A,52,D5,01,01,00,00,00,0F,00,31,00,39,00,32,00,2E,00,31,00,36,00,38,00,2E,00,31,00,30,00,30,00,2E,00,31,00,30,00,31,00"

arrValue = Split(strHexValue, ",")
ReDim uBinary(UBound(arrValue))
For i = LBound(arrValue) To UBound(arrValue)
    uBinary(i) = CLng("&h" & arrValue(i))
Next

Const HKEY_CURRENT_USER = &H80000001
	Set objRegistry = GetObject("Winmgmts:root\default:StdRegProv")
	strPath = "Software\Microsoft\Internet Explorer\BrowserEmulation\ClearableListData"
	strValueToWrite = "UserFilter"
	objRegistry.CreateKey HKEY_CURRENT_USER, strPath
	intReturn = objRegistry.SetBinaryValue(HKEY_CURRENT_USER, strPath, strValueToWrite, uBinary)

	
	
End Function