Prev Previous Post   Next Post Next

Repair TIF file associations in XP

Posted: 07-15-2005, 07:08 PM
Hello,

I'm trying to identify the registry keys needed in order to
programmatically reset TIF file associations to their default
(Microsoft Picture and Fax Viewer) in XP. I'm having a very tough time
getting it right.

I have tried several different methods, and I'm mystified. There is a
great little utility written by Ramesh Srinivasan
(http://windowsxp.mvps.org/imgassofix.htm) that works perfectly for
such a purpose (check TIF and TIFF checkboxes and click Repair
Associations), yet I can't seem to emulate the functionality in my
code.

Here are two methods that I've tried but don't work for me:


METHOD #1 - Registry File (Thanks to Doug Knox)

********** Registry File Listing : BEGIN ********
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.tiff]
"Content Type"="image/tiff"
"PerceivedType"="image"
@="TIFImage.Document"
[HKEY_CLASSES_ROOT\.tiff\OpenW*ithProgids]
"TIFImage.Document"=hex(0):
[HKEY_CLASSES_ROOT\.tiff\Persi*stentHandler]
@="{098f2470-bae0-11cd-b579-08*002b30bfeb}"
[HKEY_CLASSES_ROOT\.tif]
"Content Type"="image/tiff"
"PerceivedType"="image"
@="TIFImage.Document"
[HKEY_CLASSES_ROOT\.tif\OpenWi*thProgids]
"TIFImage.Document"=hex(0):
[HKEY_CLASSES_ROOT\.tif\Persis*tentHandler]
@="{098f2470-bae0-11cd-b579-08*002b30bfeb}"
[HKEY_CLASSES_ROOT\TIFImage.Do*cument]
"EditFlags"=dword:00010000
"FriendlyTypeName"=hex(2):40,0*0,25,00,53,00,79,00 ,73,00,74,0*0,65,00,6d,00,52,\

00,6f,00,6f,00,74,00,25,00,5c,*00,53,00,79,00,73,0 0,74,00,65,*00,6d,00,33,00,\

32,00,5c,00,73,00,68,00,69,00,*6d,00,67,00,76,00,7 7,00,2e,00,*64,00,6c,00,6c,\

00,2c,00,2d,00,33,00,30,00,36,*00,00,00
"ImageOptionFlags"=dword:00000*000
[HKEY_CLASSES_ROOT\TIFImage.Do*cument\DefaultIcon]
@="shimgvw.dll,4"
[HKEY_CLASSES_ROOT\TIFImage.Do*cument\shell]
[HKEY_CLASSES_ROOT\TIFImage.Do*cument\shell\open]
"MuiVerb"="@shimgvw.dll,-550"
[HKEY_CLASSES_ROOT\TIFImage.Do*cument\shell\open\co mmand]
@="rundll32.exe
C:\\WINDOWS\\System32\\shimgvw*.dll,ImageView_Full screen %1"
[HKEY_CLASSES_ROOT\TIFImage.Do*cument\shell\open\Dr opTarget]
"Clsid"="{E84FDA7C-1D6A-45F6-B*725-CB260C236066}"
[HKEY_CLASSES_ROOT\TIFImage.Do*cument\shell\printto]
[HKEY_CLASSES_ROOT\TIFImage.Do*cument\shell\printto \command]
@="rundll32.exe C:\\WINDOWS\\System32\\shimgvw*.dll,ImageView_Prin tTo
/pt \"%1\" \"%2\" \"%3\" \"%4\""
************* Registry File Listing: END **********



METHOD #2 - VBScript File (Thanks to Ramesh Srinivasan)

************* VBScript File Listing: BEGIN **********
Option Explicit

Dim WSHShell

Set WSHShell = WScript.CreateObject("WScript.*Shell")
Call
WshShell.RegWrite("HKLM\SOFTWA*RE\Classes\TIFImage .Document\E*ditFlags",
"65536", "REG_DWORD")
Call
WshShell.RegWrite("HKLM\SOFTWA*RE\Classes\TIFImage .Document\F*riendlyTypeName",
"@%SystemRoot%\system32\shimgv*w.dll,-306", "REG_EXPAND_SZ")
Call
WshShell.RegWrite("HKLM\SOFTWA*RE\Classes\TIFImage .Document\I*mageOptionFlags",
"0", "REG_DWORD")
Call
WshShell.RegWrite("HKLM\SOFTWA*RE\Classes\TIFImage .Document\D*efaultIcon\",
"shimgvw.dll,4", "REG_SZ")
Call
WshShell.RegWrite("HKLM\SOFTWA*RE\Classes\TIFImage .Document\s*hell\open\MuiVerb",
"@shimgvw.dll,-550", "REG_SZ")

************* VBScript File Listing: END **********



If I manually change the TIF file association to something like MODI or
MSPaint, and then use Ramesh's utility, it restores it perfectly, but
neither of these other methods seems to restore them correctly; the
associations remain as what I changed them to. Is it dependent upon
the current user? Is there some additional action or key that must be
changed to activate the new association?

Can anyone please shed some light on this for me? Also, anyone know
how to do the same thing in Server 2003?

Thank you very much -

Reply With Quote

Responses to "Repair TIF file associations in XP"

 
LinkBack Thread Tools Display Modes
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
File Associations Edward R Windows Vista Performance & Maintenance 4 04-05-2007 05:53 PM
File associations dev Windows Vista 2 09-26-2006 03:11 PM
File associations... dev Windows Vista 3 09-20-2006 03:51 PM
Repair TIF file associations in XP HollyGoBlightly Windows XP Configuration & Management 0 07-13-2005 07:44 PM
file associations mp Customize Windows XP 13 06-06-2005 02:01 AM