Ftype command in Windows

The ftype command displays or modifies the file types used in file name extension links. If used without the assignment operator (=), the ftype command will display the current string of open commands for the specified file type.

The ftype command displays or modifies the file types used in file name extension links. If used without the assignment operator (=), the ftype command will display the current string of open commands for the specified file type. If used without parameters, the ftype command will display the file types with the specified sequence of commands.

For an example of how to use this command, please see the example below.

Cu ftype ordinance

 ftype [[=[]]] 

Parameters

ParametersDescription Specifies the file type to display or change. Specify the open command string to use when opening files of the specified file type. /? Show help at the command prompt.

Note

The following table describes how the ftype command replaces the variables in an open command string:

Variable Replace value% 0 or% 1 Replaced with the file name that is launched via the link. % * Get all parameters. % 2,% 3, . Take the first parameter (% 2), the second parameter (% 3), etc. .% ~ Get all the remaining parameters starting with the Nth parameter, in where N can be any number from 2 to 9.

For example

To display the current file types with defined command sequences, enter:

 ftype 

To display the current open command string for the txtfile file type, enter:

 ftype txtfile 

This command produces the following result:

 txtfile=%SystemRoot%system32NOTEPAD.EXE %1 

To delete the open command string for a file type called Example, enter:

 ftype example= 

To link the .pl file name extension to the PerlScript file type and allow PerlScript file type to run PERL.EXE, enter the following commands:

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

To eliminate the need to type the .pl file name extension when calling a Perl script, type:

 set PATHEXT=.pl;%PATHEXT% 

See more:

  1. Fondue command in Windows
  2. Findstr command in Windows
  3. Freedisk command in Windows
3.7 ★ | 10 Vote