tonysing Posted November 5, 2014 Share Posted November 5, 2014 Hello Guys, I am doing a package of updating IE 10 to IE 11, and write the Reg Key at the same time. These are used to disable auto update and compatibility mode. #RequireAdmin ;for use in testing only Opt("TrayIconHide", 1) ;0-unhide, 1-hide the icon If(@OSArch="X86") Then ShellExecuteWait("Windows6.1-KB2533623-x86.msu","/norestart /quiet") ShellExecuteWait("Windows6.1-KB2670838-x86.msu","/norestart /quiet") ShellExecuteWait("Windows6.1-KB2729094-v2-x86.msu","/norestart /quiet") ShellExecuteWait("Windows6.1-KB2731771-x86.msu","/norestart /quiet") ShellExecuteWait("Windows6.1-KB2786081-x86.msu","/norestart /quiet") ShellExecuteWait("Windows6.1-KB2834140-v2-x86.msu","/norestart /quiet") ShellExecuteWait("IE11-Windows6.1-x86-en-us.exe","/norestart /quiet") RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN","EnableAutoUpgrade","REG_DWORD",0) ;For Reg_Dword, the input value is integer and should NOT be double quotes RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\BrowserEmulation","AllSitesCompatibilityMode","REG_DWORD",0) RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\BrowserEmulation","IntranetCompatibilityMode","REG_DWORD",0) Else ShellExecuteWait("Windows6.1-KB2533623-x64.msu","/norestart /quiet") ShellExecuteWait("Windows6.1-KB2670838-x64.msu","/norestart /quiet") ShellExecuteWait("Windows6.1-KB2729094-v2-x64.msu","/norestart /quiet") ShellExecuteWait("Windows6.1-KB2731771-x64.msu","/norestart /quiet") ShellExecuteWait("Windows6.1-KB2786081-x64.msu","/norestart /quiet") ShellExecuteWait("Windows6.1-KB2834140-v2-x64.msu","/norestart /quiet") ShellExecuteWait("IE11-Windows6.1-x64-en-us.exe","/norestart /quiet") RegWrite("HKLM64\SOFTWARE\Microsoft\Internet Explorer\MAIN","EnableAutoUpgrade","REG_DWORD",0) RegWrite("HKCU64\SOFTWARE\Microsoft\Internet Explorer\BrowserEmulation","AllSitesCompatibilityMode","REG_DWORD",0) RegWrite("HKCU64\SOFTWARE\Microsoft\Internet Explorer\BrowserEmulation","IntranetCompatibilityMode","REG_DWORD",0) EndIf Exit 0 However, when I want to disable the compatibility mode of IE(AllSitesCompatibilityMode, IntranetCompatibilityMode). Those Reg Key just remain unchanged even that the error code is 0. For the first RegWrite(EnableAutoUpdate), it run without problem. Just the last two line encounter issues. I have tried to change the counterpart Reg Key in HKLM, although it successfully changed the key, the setting seems to depend on HKCU and doesn't work at all. Can anyone tell me how should I do it? P.S: Please do NOT tell me that change them manually, it is meaningless to me as this script is used for distributing update in SCCM. Link to comment Share on other sites More sharing options...
Solution jguinch Posted November 5, 2014 Solution Share Posted November 5, 2014 First, for these HKCU values, you don't need to use HKCU64 : RegWrite("HKCU64\SOFTWARE\Microsoft\Internet Explorer\BrowserEmulation","AllSitesCompatibilityMode","REG_DWORD",0) RegWrite("HKCU64\SOFTWARE\Microsoft\Internet Explorer\BrowserEmulation","IntranetCompatibilityMode","REG_DWORD",0) It works. But now, you are using #RequireAdmin, so you may have to enter your Admin credentials : did you look at the HKCU registry hive in this Admin profile ? HKCU is specific to each user, the values you are writing are only for the user who runs the script, not the others Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now