Office Viewer Patches changing file association

(imported topic written by gjeremia91)

Nov. Patching set included a few MS document viewer patches. In my testing, these patches (in 1 case) don’t work, (MS issue, not BF) and in the other cases reset file associations to the viewer. Not a problem if you only have viewers…but if your target population have both, makes for some ANGRY peeps !!

I’ve written a dashboard/wizard for some customers baseline generation as it includes a few custom things, and EXCLUDES OS’ that they don’t care about. It also includes some logic for pre-patch and post-patching.

So, in hind-site, I’d copy off HKCR and restore it at the end of the baseline. This keeps the old associations, and doesn’t overwrite anything NEW, just anything CHANGED.

however, in the interim, I have created a task to try and remedy the situation for the major doc types:

delete __appendfile
delete officeext.bat

appendfile @ECHO OFF
if {exists (keys whose (name of it starts with “Word.Document” and (exists key “shell\open\command” whose (exists value “” of it and value “” of it as string as lowercase contains “winword.exe”) of it)) of key “HKCR” of registry)}
appendfile @set WORD={preceding text of first “;” of concatenation “;” of (unique values of (names of keys whose (name of it starts with “Word.Document” and (exists key “shell\open\command” whose (exists value “” of it and value “” of it as string as lowercase contains “winword.exe”) of it)) of key “HKCR” of registry);";")}
appendfile @assoc .doc=%WORD%
appendfile @assoc .dot=%WORD%
endif
if {exists (keys whose (name of it starts with “Excel.Sheet” and (exists key “shell\open\command” whose (exists value “” of it and value “” of it as string as lowercase contains “excel.exe”) of it)) of key “HKCR” of registry)}
appendfile @set EXCEL={preceding text of first “;” of concatenation “;” of (unique values of (names of keys whose (name of it starts with “Excel.Sheet” and (exists key “shell\open\command” whose (exists value “” of it and value “” of it as string as lowercase contains “excel.exe”) of it)) of key “HKCR” of registry);";")}
appendfile @assoc .xls=%EXCEL%
appendfile @assoc .csv=%EXCEL%
endif
if {exists (keys whose (name of it starts with “PowerPoint.Slide” and (exists key “shell\open\command” whose (exists value “” of it and value “” of it as string as lowercase contains “powerpnt.exe”) of it)) of key “HKCR” of registry)}
appendfile @set PPNT={preceding text of first “;” of concatenation “;” of (unique values of (names of keys whose (name of it starts with “PowerPoint.Slide” and (exists key “shell\open\command” whose (exists value “” of it and value “” of it as string as lowercase contains “powerpnt.exe”) of it)) of key “HKCR” of registry);";")}
appendfile @assoc .ppt=%PPNT%
appendfile @assoc .pps=%PPNT%
appendfile @assoc .pot=%PPNT%
endif

if {exists (keys whose (name of it starts with “Visio.Drawing” and (exists key “shell\open\command” whose (exists value “” of it and value “” of it as string as lowercase contains “visio.exe”) of it)) of key “HKCR” of registry)}
appendfile @set VISIO={preceding text of first “;” of concatenation “;” of (unique values of (names of keys whose (name of it starts with “Visio.Drawing” and (exists key “shell\open\command” whose (exists value “” of it and value “” of it as string as lowercase contains “visio.exe”) of it)) of key “HKCR” of registry);";")}
appendfile @assoc .vsd=%VISIO%
appendfile @assoc .vdx=%VISIO%
endif

move __apPendfile officeext.bat
waithidden officeext.bat