Hi,
Windows has two command line utilities to alter the application associated with a file extension.
First of all deterine the installed application. ftype gets the whole list of programs registered in HKEY_CLASSES_ROOT.
The HKEY_CLASSES_ROOT tree is a view combined by merging HKEY_CURRENT_USER\Software\Classes and HKEY_LOCAL_MACHINE\Software\Classes.
1 | D:\> ftype |
For example you want to change the file extension .pdf to the Acrobat Reader.
assoc list the current appication associated with .pdf
1 | D:\> assoc .pdf |
Then determine the application name
1 2 3 4 5 6 7 8 | D:\> ftype | findstr /i acrobatacrobat="C:\Program Files (x86)\Adobe\Acrobat Reader 2017\Reader\AcroRd32.exe" / u "%1"AcroExch.acrobatsecuritysettings.1="C:\Program Files (x86)\Adobe\Acrobat Reader 2017\Reader\AcroRd32.exe" "%1"AcroExch.Document.2017="C:\Program Files (x86)\Adobe\Acrobat Reader 2017\Reader\AcroRd32.exe" "%1"AcroExch.FDFDoc="C:\Program Files (x86)\Adobe\Acrobat Reader 2017\Reader\AcroRd32.exe" "%1"AcroExch.pdfxml.1="C:\Program Files (x86)\Adobe\Acrobat Reader 2017\Reader\AcroRd32.exe" "%1"AcroExch.XDPDoc="C:\Program Files (x86)\Adobe\Acrobat Reader 2017\Reader\AcroRd32.exe" "%1"AcroExch.XFDFDoc="C:\Program Files (x86)\Adobe\Acrobat Reader 2017\Reader\AcroRd32.exe" "%1" |
and link the .pdf extension to.
1 | D:\> assoc .pdf=AcroExch.Document.2017 |
Michael