Из командного окна вы можете использовать команды «ASSOC» и «FTYPE» для добавления / редактирования / удаления ассоциаций типов файлов.
C:>assoc /? ASSOC [.ext[=[fileType]]] .ext Specifies the file extension to associate the file type with fileType Specifies the file type to associate with the file extension Type ASSOC without parameters to display the current file associations. If ASSOC is invoked with just a file extension, it displays the current file association for that file extension. Specify nothing for the file type and the command will delete the association for the file extension.
а также:
C:>ftype /? FTYPE [fileType[=[openCommandString]]] fileType Specifies the file type to examine or change openCommandString Specifies the open command to use when launching files of this type. Type FTYPE without parameters to display the current file types that have open command strings defined. FTYPE is invoked with just a file type, it displays the current open command string for that file type. Specify nothing for the open command string and the FTYPE command will delete the open command string for the file type. Within an open command string %0 or %1 are substituted with the file name being launched through the assocation. %* gets all the parameters and %2 gets the 1st parameter, %3 the second, etc. %~n gets all the remaining parameters starting with the nth parameter, where n may be between 2 and 9, inclusive. ... ...
Итак (в моей системе), в отношении файлов .bkr, эти команды возвращают:
C:>assoc .bkr .bkr=bkrfile C:>ftype bkrfile bkrfile="F:\Program Files\path...\program.exe" "%1"
Я создал новое «тестовое» расширение файла / тип файла (может потребоваться разрешение администратора):
C:>assoc .bzb File association not found for extension .bzb C:>assoc .bzb=MyBZBCustomFileType .bzb=MyBZBCustomFileType C:>assoc .bzb .bzb=MyBZBCustomFileType C:>ftype MyBZBCustomFileType File type 'MyBZBCustomFileType' not found or no open command associated with it. C:>ftype MyBZBCustomFileType=%SystemRoot%\system32\NOTEPAD.EXE %1 MyBZBCustomFileType=C:\Windows\system32\NOTEPAD.EXE %1 C:>echo Some text.>C:\Temp\file.bzb C:>start "" C:\Temp\file.bzb
Откроется «Блокнот», редактирующий мой «фиктивный» файл.
Чтобы удалить сопоставление типов файлов, сначала удалите соединение типа файла с программой следующим образом:
C:>ftype MyBZBCustomFileType MyBZBCustomFileType=C:\Windows\system32\NOTEPAD.EXE %1 C:>ftype MyBZBCustomFileType= File type 'MyBZBCustomFileType' not found or no open command associated with it.
Затем удалите ассоциацию расширения файла (может потребоваться разрешение администратора):
C:>assoc .bzb .bzb=MyBZBCustomFileType C:>assoc .bzb= C:>assoc .bzb File association not found for extension .bzb C:>start "" C:\Temp\file.bzb (The dialogbox "Windows cannot open this file" opens) C:>
----
Для решения с графическим интерфейсом я использую PowerTools от Creative Elements . Вы можете скачать и использовать его бесплатно в течение 45 дней на пробную версию. Это набор инструментов, и вы будете использовать их File Type Doctor
инструмент для добавления / редактирования / удаления ассоциаций типов файлов.