批處理指令碼 - ASSOC



這是一條批處理命令,用於將副檔名與檔案型別 (FTYPE) 相關聯,顯示現有關聯或刪除關聯。

語法

assoc – Displays all the file extensions 
assoc | find “.ext” – Displays only those file extensions which have the extension ext.

示例

@echo off 
assoc > C:\lists.txt 
assoc | find “.doc” > C:\listsdoc.txt

輸出

檔案關聯列表會路由到檔案 lists.txt。在執行上述批處理檔案後,以下輸出顯示了 listsdoc.txt 檔案中的內容。

.doc=Word.Document.8 
.dochtml=wordhtmlfile 
.docm=Word.DocumentMacroEnabled.12 
.docmhtml=wordmhtmlfile 
.docx=Word.Document.12 
.docxml=wordxmlfile
batch_script_commands.htm
廣告