Ftype
Displays or modifies file types used in file name extension associations. Used without parameters, ftype displays the file types that have open command strings defined.
Syntax
Ftype [FileType[=[OpenCommandString]]]
Parameters
- FileType
-
Specifies the file type you want to display or change.
- OpenCommandString
-
Specifies the open command to use when opening files of this type.
- /?
-
Displays help at the command prompt.
Remarks
-
The following table lists how ftype substitutes variables within an OpenCommandString.
|
Variable
|
Replacement value
|
|---|
%0 or %1 | Replaced with the file name that you want to open |
%* | Replaced with all of the parameters |
%~N | Replaced with all of the remaining parameters, starting with the Nth parameter, where N can be any number from 2 to 9 |
%2 | Replaced with the first parameter, %3 with the second, and so on |
Examples
To display the current file types that have open command strings defined, type:
ftype
To display the current open command string for a specific file type, type:
ftypeFileType
To delete the open command string for a specific file type, type:
ftypeFileType=
Type:
ASSOC .pl=PerlScript FTYPE PerlScript=perl.exe %1 %*
To invoke the Perl script, type:
script.pl 1 2 3
To eliminate the need to type the extensions, type:
set PATHEXT=.pl;%PATHEXT%
To invoke the Perl script, type:
script 1 2 3
Formatting legend
|
Format
|
Meaning
|
|---|
Italic | Information that the user must supply |
Bold | Elements that the user must type exactly as shown |
Ellipsis (...) | Parameter that can be repeated several times in a command line |
Between brackets ([]) | Optional items |
Between braces ({}); choices separated by pipe (|). Example: {even|odd} | Set of choices from which the user must choose only one |
Courier font
| Code or program output |
See Also