Sunday, September 25, 2011

Restore Active Desktop Fix for IE7

So you just upgraded your Internet Explorer to version 7 or higher. Or you just have the older version and all of a sudden after an improper shutdown or what ever the cause maybe you encountered this annoying "Active Desktop Recovery" and after logging in and no matter how much you press the "Restore my Active Desktop" button it just doesn't do it's thing? Oh well, fear not for I will show you a fix to this issue.


Below is a short and simple vbscript that will just do the trick in fixing Active Desktop back to its original state.

HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objReg = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Internet Explorer\Desktop\SafeMode\Components"
strValue = "0"
ValueName = "DeskHtmlVersion"
objReg.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, ValueName, strValue

How to use the piece of code above? Just simple! Copy the code above and paste it to notepad. When saving use the "Save As" option and you will be prompted for a location and name of file to save. When naming the file put it inside quotes "" and give it a file extension of .vbs. Double click on the file you just created then refresh your Desktop. This will restore your Desktop to its normal state.

Here is an explanation of the code above:

HKEY_CURRENT_USER = &H80000001
We are creating a constant variable called HKEY_CURRENT_USER and giving it a value of &H80000001.

 strComputer = "."
Another variable where in the value inside the quotes is a ".", which means your local computer or a remote computer.

Set objReg = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
Creates an object out of the registry class StdRegProv. This containes functions to manipulate the registry.

strKeyPath = "Software\Microsoft\Internet Explorer\Desktop\SafeMode\Components"
A variable defining the path to the registry key to edit.

strValue = "0"
ValueName = "DeskHtmlVersion"
String values that would be entered to the registry key.

objReg.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, ValueName, strValue
The command that does it all. This will set the values for the registry key of the Current User hive.

 You can fix remote PCs encountering Active Desktop issues by specifying the remote PC name under strComputer variable.
strComputer = "RemotePCName"

That is all! I hope this would be helpful to anyone out there experiencing this Desktop issue.

No comments:

Post a Comment