Post Reply
Joshua 2010-01-12 06:50
Well, our office has gotten rather frustrated with the whole Adobe/Ultramon glitch where Adobe crashes when a users tries to move the Acrobat window from one monitor to the other while adobe is maximized. So, I create a nifty script that will add the proper entries to your registry in order to fix the problem:
Set objShell = Wscript.CreateObject("Wscript.Shell")
blnAppComp = False
blnAcrobat = False
blnWinMove = False
blnAcroName = False
'check to see if this version of ultramon is compatible with this type of registry manupulation
If KeyExists("HKCU\Software\Realtime Soft\UltraMon Components") Then
'See what fixes need to be applied
If KeyExists("HKCU\Software\Realtime Soft\UltraMon Components\AppCompat") Then
blnAppComp = False
End If
If Not KeyExists("HKCU\Software\Realtime Soft\UltraMon Components\AppCompat\Acrobat.exe") Then
blnAcrobat = True
End If
If Not ValExists("HKCU\Software\Realtime Soft\UltraMon Components\AppCompat\Acrobat.exe\MoveMaxWndViaRestore") Then
blnWinMove = True
End If
If Not ValExists("HKCU\Software\Realtime Soft\UltraMon Components\AppCompat\Acrobat.exe\Name") Then
blnAcroName = True
Else
'Make sure this value is correct
strVal = objShell.RegRead("HKCU\Software\Realtime Soft\UltraMon Components\AppCompat\Acrobat.exe\Name")
If Not strVal = "Adobe Acrobat 9.0" Then
blnAcroName = True
End If
End If
'Apply the fixes
On Error Resume Next
If blnAcrobat Then
objShell.RegWrite "HKCU\Software\Realtime Soft\UltraMon Components\AppCompat\", null
End If
If blnAcrobat Then
objShell.RegWrite "HKCU\Software\Realtime Soft\UltraMon Components\AppCompat\Acrobat.exe\", null
End If
If blnWinMove Then
objShell.RegWrite "HKCU\Software\Realtime Soft\UltraMon Components\AppCompat\Acrobat.exe\MoveMaxWndViaRestore", 1, "REG_DWORD"
End If
If blnAcroName Then
objShell.RegWrite "HKCU\Software\Realtime Soft\UltraMon Components\AppCompat\Acrobat.exe\Name", "Adobe Acrobat 9.0", "REG_SZ"
End If
On Error Goto 0
End If
'this is the function to see if a key exists
Function KeyExists(ByVal sRegKey)
' Returns True or False based on the existence of a registry key.
Dim sDescription, oShell
Set oShell = CreateObject("WScript.Shell")
KeyExists = True
sRegKey = Trim (sRegKey)
If Not Right(sRegKey, 1) = "\" Then
sRegKey = sRegKey & "\"
End If
On Error Resume Next
oShell.RegRead "HKEYNotAKey\"
sDescription = Replace(Err.Description, "HKEYNotAKey\", "")
Err.Clear
oShell.RegRead sRegKey
KeyExists = sDescription <> Replace(Err.Description, sRegKey, "")
On Error Goto 0
End Function
'this is the function to see if a value exists
Function ValExists(sRegValue)
' Returns True or False based of the existence of a registry value.
Dim oShell, RegReadReturn
Set oShell = CreateObject("WScript.Shell")
ValExists = True ' init value
On Error Resume Next
RegReadReturn = oShell.RegRead(sRegValue)
If Err.Number <> 0 Then
ValExists = False
End if
On Error Goto 0
End Function
Joshua K. IT Support
|
Christian Studer 2010-01-12 09:38
Thanks for sharing the script!
Christian Studer - www.realtimesoft.com
|
B 2010-11-23 01:45
How do I use this script? Where does it go?
|
Christian Studer 2010-11-23 08:35
You would only need to run this once, but if you don't have multiple systems you can just set up compatibility settings for Acrobat via UltraMon Options > Compatibility.
BTW, this issue only occurs if Acrobat gets launched from CCH ProSystem Engagement.
Christian Studer - www.realtimesoft.com
|
Post Reply
|