Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Set .ai association for Reader

I've struggled mightily trying to push out default file associations for .ai files. We use Adobe Reader to open .ai files throughout the company. Many of the traditional methods, like cmd-line ftype and assoc commands, do not seem to work for this specific extension. Or maybe I just suck at IT. Hopefully you can save me some time every time I push out a Reader update or deploy a new PC.

0

Comments

8 comments
Date Votes
  • The way file associations work changed completely in Windows 8 and 10. Which version of Windows are you using?

    In Windows 10 the easiest way to force file associations is to set them manually on one computer, export those associations as an XML file then use that file in Group policy. Here is a link below similar to how i used to do it in the past.

    https://www.loginvsi.com/blog/login-vsi/518-fixing-default-file-type-associations-in-windows-10

    0
  • Sorry I forgot to mention we run Windows 7 in production. Since we'll be deploying 10 later this year the above is very useful.

    Under Windows 7 I have changed default file associations using the ftype and assoc commands, but could never get it to associate .ai files properly.

    0
  • Um, powershell?

     

    #Creates a PS Drive for the Classes_Root registry Hive.
    New-PSDrive -PSProvider registry -Root HKEY_CLASSES_ROOT -Name HKCR | Out-Null

    #Change directory to the new drive
    Set-Location HKCR:

    #Grab the name of the application currently handling PDF files. Since it is Adobe Reader as well, it works for your .ai needs as well.
    $assoc = (Get-ItemProperty .\.pdf -Name ‘(default)’).'(default)’

    #Update the key for .ai to be the same application as the pdf file extension
    Set-ItemProperty -Path .\.ai -Name ‘(default)’ -Value $assoc -Type String

     

    This should in theory copy the application that handles pdf files (Adobe Reader), to the .ai extension making Adobe Reader the default for that as well. This isn't tested, and kinda off the cuff, but should do what you need for your Win 7 clients.

     

    EDIT: I fixed the script above. I had some time to test tonight, and the code above correctly changes the registry key. I have an illustrator file floating around I believe that I can use to fully test this for you. Stand by.

    1
  • I've confirmed that the above provided code correctly associates the file on a Windows 8.1 machine. There will be no difference with the method I have provided between Windows 7 and Windows 8.1. I've also tested it on Windows 10, and it works there as well, so this should be a one-stop method for now and future needs.

     

    To execute this, rather create a powershell step and paste the code into it, or save the code as a ps1 file and then say "Insert Script File" inside the Powershell Step Window.

    Please let me know if you have issues with the script, or need further assistance.

    0

  • Stephen I could kiss you right now! Confirmed it working here on 7 and 10. Thank you so much!


    Created job in Deploy with just the script so I can run it stand-alone, then nested it in the Package Library Reader DC install package. Now to make a condition check for Illustrator, and skip that step if true.


    I can freely update Reader without worrying about half the company not being able to open Illustrator files


     I love this community!


    0
  • Haha, glad it worked. Embrace the powershell, it is your friend.

    0
  • A nice idea for the package library.

    0
  • Do you have a way to set Adobe Acrobat DC as default pdf handler rather edge using powershell? I kind of struggle doing that using powershell. Thanks.

    0