CMD ftype 命令详解


显示 (或修改) 用于文件扩展名关联的文件类型。

另请参阅: assoc     start

Basic Usage     Detailed Usage

D:/digital translate> ASSOC .html
.html=htmlfile
D:/digital translate> FTYPE htmlfile
htmlfile="C:\Program Files (x86)\Internet Explorer\IEXPLORE.EXE" -nohome
D:/digital translate>
			

不带参数键入 FTYPE 显示打开命令字符串定义的当前文件类型。

仅仅带文件类型援引 FTYPE,显示用于该文件类型的当前打开命令字符串。

不指定打开命令字符串,FTYPE 命令将删除文件类型打开命令字符串。

基本语法

FTYPE [fileType[=[openCommandString]]]
			

选项参数

参数 EN 解释 中文翻译 Remark
fileType Specifies the file type to examine or change 指定要审查 (或更改) 的文件类型
openCommandString Specifies the open command to use when launching files of this type. 指定要使用的打开命令,当发起此类型的文件时。

Basic Usage

Function 命令 文字解释 示例 示例解释
帮助 ftype /? 展示帮助信息

在打开命令字符串中,%0 或 %1 代入关联发起文件名。

%* 获取所有参数,%2 获取第一参数,%3 获取第二参数,依此类推。

%~n 获取从第 n 参数开始的所有剩余参数,其中 n 可以在 2 到 9 之间 (包括 2 和 9)。例如:

ASSOC .pl=PerlScript

FTYPE PerlScript=perl.exe %1 %*

将允许援引 Perl 脚本如下所示:

script.pl 1 2 3

若想要消除需要键入扩展名,则执行以下:

set PATHEXT=.pl;%PATHEXT%

且可以援引脚本如以下所示:

script 1 2 3

 

Copyright Notice: This article is an exclusive original manuscript, copyright belongs to Happy Digits Software , shall not be reproduced without permission.