Change Windows File Associations via the Command Prompt

The blow shows how to reset file associations via the command prompt.

File associations are per user

Commands
asscoc .<filetype>     Gets the system name for the file type

ftype <system name>      Shows you the path to the current associated program

ftype <system name>=<path> arguments     Changes the association to the provided path

Example (using a DOCX Word file)

Find what the association should be

Either on the same computer as a different users or on a different computer;

RUN:                 asscoc .docx
RETURNS:         .docx=Word.Document.12

RUN:                 ftype docx=Word.Document.12
RETURNS:         Word.Document.12=”C:\PROGRA~2\MICROS~2\OFFICE11\WINWORD.EXE” /n /dde

Logged on as the effected user

Open an administrative command prompt by right-clicking on CMD and selecting “Run as Administrator”

RUN: ftype      PCOMW\WS=Word.Document.12=”C:\PROGRA~2\MICROS~2\OFFICE11\WINWORD.EXE” /n /dde (No spaces around the =’s)
RETURNS:       PCOMW\WS=Word.Document.12=”C:\PROGRA~2\MICROS~2\OFFICE11\WINWORD.EXE” /n /dde

Troubleshoot

If you get an error like the below then you are not running in an administrative command propmt

Access is denied.
Error occurred while processing: pcomw\ws.

2 thoughts on “Change Windows File Associations via the Command Prompt”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.