PDF File Association Server 2012

This will stop Windows from resetting your default file associations, and this will force your choice of application to stick. It works well for my org.

#Creates a "drive" to access the HKCR (HKEY_CLASSES_ROOT)
New-PSDrive -Name HKCR -PSProvider Registry -Root 
HKEY_CLASSES_ROOT

If ('HKCR:\.pdf')
{
    #This is the .pdf file association string
    $PDF = 'HKCR:\.pdf'
    New-ItemProperty $PDF -Name NoOpenWith
    New-ItemProperty $PDF -Name NoStaticDefaultVerb
}

If ('HKCR:\.pdf\OpenWithProgids')
{
    #This is the .pdf file association string
    $Progids = 'HKCR:\.pdf\OpenWithProgids'
    New-ItemProperty $Progids -Name NoOpenWith
    New-ItemProperty $Progids -Name NoStaticDefaultVerb
}
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...