none
How to change Windows 7 file associations in the registry

    Question

  • Hi,

    I have a group of computers that have Office 2010 installed and then PowerPoint Viewer 2007 was installed after that to temporarily resolve an SCCM 2007 patching issue. Needless to say, PowerPoint Viewer 2007 changed some of the PowerPoint 2010 file associations to itself instead. I am scripting a clean-up operation to remove PowerPoint Viewer 2007 and set the file associations back to PowerPoint 2010. After doing some research, the few registry paths commonly called out do not contain the information that I am looking to change.

    HKEY_CLASSES_ROOT
    HKEY_CLASSES_ROOT\Applications
    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts

    The file associations that I need to set back to PowerPoint 2010 are as follows:
    .potm, .potx, .ppsm, .ppsx, .pptm, .pptx

    Does anybody know where to look for where these file associations are set in the registry?

    Thanks,
    Rob
    Monday, May 07, 2012 9:04 PM

Answers

  • This is how it is done in vbscript as well:

    http://www.visualbasicscript.com/tm.aspx?high=&m=97211&mpage=1#97217

    Set objShell = Wscript.CreateObject("WScript.Shell")
    
    objShell.RegWrite "HKCR\.potm\", "PowerPoint.TemplateMacroEnabled.12", "REG_SZ"
    objShell.RegWrite "HKCR\.potx\", "PowerPoint.Template.12", "REG_SZ"
    objShell.RegWrite "HKCR\.ppsm\", "PowerPoint.SlideShowMacroEnabled.12", "REG_SZ"
    objShell.RegWrite "HKCR\.ppsx\", "PowerPoint.SlideShow.12", "REG_SZ"
    objShell.RegWrite "HKCR\.pptm\", "PowerPoint.ShowMacroEnabled.12", "REG_SZ"
    objShell.RegWrite "HKCR\.pptx\", "PowerPoint.Show.12", "REG_SZ"

    One thing to note is that the user will need to log out and log in again to reload the changes to the registry which also updates the change to the file extensions.




    • Marked as answer by robwm1 Monday, May 07, 2012 10:26 PM
    • Edited by robwm1 Monday, May 07, 2012 10:31 PM
    Monday, May 07, 2012 10:26 PM

All replies

  • Hi,

    maybe another method is to launch setup in repair mode?
    http://technet.microsoft.com/en-us/library/cc178956.aspx#BKMK_repair


    Don

    Monday, May 07, 2012 9:16 PM
  • I did some more looking and came across the ASSOC command. I setup a simple batch file and it seems to do the trick. I would prefer to change the registry directly if anyone knows how to do it but this batch file does work as an alternative:

    @echo off
    cls

    assoc .potm=PowerPoint.TemplateMacroEnabled.12
    assoc .potx=PowerPoint.Template.12
    assoc .ppsm=PowerPoint.SlideShowMacroEnabled.12
    assoc .ppsx=PowerPoint.SlideShow.12
    assoc .pptm=PowerPoint.ShowMacroEnabled.12
    assoc .pptx=PowerPoint.Show.12

    Monday, May 07, 2012 9:36 PM
  • This is how it is done in vbscript as well:

    http://www.visualbasicscript.com/tm.aspx?high=&m=97211&mpage=1#97217

    Set objShell = Wscript.CreateObject("WScript.Shell")
    
    objShell.RegWrite "HKCR\.potm\", "PowerPoint.TemplateMacroEnabled.12", "REG_SZ"
    objShell.RegWrite "HKCR\.potx\", "PowerPoint.Template.12", "REG_SZ"
    objShell.RegWrite "HKCR\.ppsm\", "PowerPoint.SlideShowMacroEnabled.12", "REG_SZ"
    objShell.RegWrite "HKCR\.ppsx\", "PowerPoint.SlideShow.12", "REG_SZ"
    objShell.RegWrite "HKCR\.pptm\", "PowerPoint.ShowMacroEnabled.12", "REG_SZ"
    objShell.RegWrite "HKCR\.pptx\", "PowerPoint.Show.12", "REG_SZ"

    One thing to note is that the user will need to log out and log in again to reload the changes to the registry which also updates the change to the file extensions.




    • Marked as answer by robwm1 Monday, May 07, 2012 10:26 PM
    • Edited by robwm1 Monday, May 07, 2012 10:31 PM
    Monday, May 07, 2012 10:26 PM
  • Hi Rob

    you can try and delete the UserChoice Key.

    open registry under users profile and go to hkey_current_user\software\microsoft\windows\currentversion\explorer\fileExts\.lnk

    you will see 3 keys under .lnk

    delete UserChoice

    thanks

    Imtiaz


    Wednesday, July 16, 2014 6:32 AM