Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit editor mode

ftype

Feedback

In this article

Displays or modifies file types that are used in file name extension associations. If used without an assignment operator (=), this command displays the current open command string for the specified file type. If used without parameters, this command displays the file types that have open command strings defined.

Note

This command is only supported within cmd.exe and is not available from PowerShell.Though you can usecmd /c ftype as a workaround.

Syntax

ftype [<filetype>[=[<opencommandstring>]]]

Parameters

ParameterDescription
<filetype>Specifies the file type to display or change.
<opencommandstring>Specifies the open command string to use when opening files of the specified file type.
/?Displays help at the command prompt.

Remarks

The following table describes howftype substitutes variables within an open command string:

VariableReplacement value
%0 or%1Gets substituted with the file name being launched through the association.
%*Gets all of the parameters.
%2,%3, ...Gets the first parameter (%2), the second parameter (%3), and so on.
%~<n>Gets all of the remaining parameters starting with thenth parameter, wheren can be any number from 2 to 9.

Examples

To display the current file types that have open command strings defined, type:

ftype

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

ftype txtfile

This command produces output similar to the following:

txtfile=%SystemRoot%\system32\NOTEPAD.EXE %1

To delete the open command string for a file type calledexample, type:

ftype example=

To associate the .pl file name extension with the PerlScript file type and enable the PerlScript file type to run PERL.EXE, type the following commands:

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

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

set PATHEXT=.pl;%PATHEXT%

Related links


Feedback

Was this page helpful?

YesNoNo

Need help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?

  • Last updated on

In this article

Was this page helpful?

YesNo
NoNeed help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?