DEV Community

Victor James
Victor James

Posted on • Originally published at windowscmd.com on

FTYPE

FTYPE

FTYPE

The FTYPE windows command-line tool is to display or else changes File type utilized in extension file associations.

CMD Line

CMD Line is a text-based interface that transfers the command from the user to the OS.

CLI-Command Line Interpreter

The command-line interpreter (CLI) for windows is CMD.EXE. Also, you can use PowerShell which can automize many system administration tasks and these tasks are not approachable in command prompt. With the help of the CLI, you can communicate with your system by typing the text in commands. As a result, your system answers to the text that you have typed previously, and then the user can proceed with the next command line that shows up.

To open the Run command Window

Run command window helps you to run programs, open the files and folders. And there are several ways to open up the run command dialog box. This run command box is useful for you to head straight to the destined program easily.

By using the Keyboard shortcut Key:

WINDOWS+R

One of the most commonly used methods is the Shortcut key method. Also, this method is in all versions of Windows. You need to press the Windows+ R key concurrently to open the Run command dialog box.

Run command box
Run command box

What does the FTYPE command do?

The FTYPE windows command-line tool is to display or else changes File type utilized in extension file associations. This command is to display or modify the link between a file type and executable program. FTYPE is an Internal command.

The FTYPE command line will not process if command extensions are not enabled.

Syntax


   FTYPE fileType=executable_path

   FTYPE

   FTYPE fileType

   FTYPE fileType=

Enter fullscreen mode Exit fullscreen mode

Parameter Explanation

  • fileType – Type of file
  • executable_path – Specifies the executable program, including any command line parameters.

  • In Windows , File types can be displayed using

Apps→Default apps→Choose default apps by file type

In the settings pane , there is no feature like adding file association for a non-Windows store application using the GUI manually. As the Settings pane will simply display the installed applications and/or an option to install apps from the Windows store. But you can make it by the use FTYPE on the command line.

List of Common File Extensions and File Types:

  • The same executable application can be, linked to certain file types.
  • FTYPE filetype will display the current executable program for that file type, e.g., FTYPE pngfile.

Without the parameters, the FTYPE will show all the File types and each executable program.

  • One or more file extensions can be linked with the same file type
    • For example, the .JPG and .JPEG can be linked as “jpeg file” File type.
  • That the path file is as File Extension >> File Type >> executable program

    • For example the path file will be .TXT > txtfile >> \system32\WORDPAD.EXE
  • Prior to making a File Association with ASSOC , a File Type must be created.

    • For instance
    • FTYPE word.rtf.8=”C:\Program Files\Microsoft Office\Office\winexcel.exe” /n
      ASSOC .rtf=word.rtf.8

Parameters of Command line

The command-line parameters are like batch file parameters

  • %0 Gets replaced with the file name being launched through the association.
  • %1 Gets replaced with the file name being launched through the association.
  • %2, %3 if any parameters are required by the application.
  • %* for to pass all parameters.
  • %~n To pass all the remaining parameters, starting with the nth parameter, where n is between 2 and 9.

Switch between multiple applications

The ASSOC command can be used to switch the file extension between the different File Types if you have multiple applications that use the same file extension. It does not delete the file type for the other application, but it will remain so that you can easily switch back.

Deleting a FileTypes

  • You have to indicate executable_path=
  • Then the FTYPE command will delete the executable_path= for that specified file type.
    • For example
    • FTYPE txtfile=

Back up FileTypes

  • In order to back up, files use

FTYPE >backup_types.txt
ASSOC >backup_ext.txt

Enter fullscreen mode Exit fullscreen mode

Using file associations at the command line

  • In case if you have a file association between .DOC and Word for Windows, then at a command prompt you can open a document by using

Start "My Document.doc"
"Daily Report.doc"
TUESDAY.DOC

Enter fullscreen mode Exit fullscreen mode

NOTE : File extension must be provided

Error levels

  • %ERRORLEVEL%=0 shows If the file Type Association was successfully modified.
  • %ERRORLEVEL%=1 will show up if the File Type Association could not be changed.
  • %ERRORLEVEL%=unchanged typically this will be 0 but if a previous command set an error level , that will be conserved.

Verdict

In this article we have stated about the FTYPE windows command-line tool is to display or else changes File type utilized in extension file associations. If you have any suggestions or questions regarding this article, let us know in the comment section, we will update it to you shortly.

Related articles

  • GPUPDATE The GPUPDATE windows command-line tool is used to update the Group Policy settings.
  • FTYPE The FTYPE windows command-line tool is to display or else changes File type utilized in extension file associations. FTYPE is an Internal command.
  • GETMAC The GETMAC windows command-line tool is to display the Media Access Control (MAC) address and a list of network protocols.
  • GPRESULT The GPRESULT windows command-line tool is to display the Resultant Set of Policy information.
  • GOTO The GOTO windows command-line tool is to direct a batch program to jump to a labeled line. This command directs the command processing to a line that is identified by a label within a batch program.

The post FTYPE appeared first on Windows Commands- SS64 Commands.

Discussion (0)