FTYPE

(from File Type)

Displays or changes the file types used in file extension associations.

FTYPE [fileType[=[open_command]]]

Where:

  • fileType - Specifies the type of file to show or modify.
  • open_command - Specifies the open command to use when launching files of this type.

Without parameters, displays the current file types that have open command strings defined. If open_command is not specified but the equals sign = is specified, deletes the string for the specified file type.

The name of the file that is run through the association is formed by %0 or %1. %* receives all parameters, %2 the first parameter, %3 the second, and so on. %~n receives all remaining parameters starting with the parameter n (where n is a positive integer between 2 and 9, inclusive). Example:

assoc .pl=PerlScript
ftype PerlScript=perl.exe %1 %*

which associates the .pl extension with the PerlScript file type (see ASSOCASSOC) which is then associated with the perl.exe application, allowing you to call a PERLPERL script with arguments in the following way:

script.pl 1 2 3

See SHIFTSHIFT for a little more information.

Examples:

1. Associate the C:\WINDOWS\system32\giant.exe application to the GiantFile file type:

ftype GiantFile="C:\WINDOWS\system32\giant.exe"

 

2. Dissociate the FukingVirus file type from the C:\Program Files\Fuking Virus Anti-Virus\fvirus.exe application (hopefully a fantasy program):

ftype FukingVirus=

Comments