Set windows 10 default app via file type

Target: Set default app for specific file type

For instance, I want to set deault app for rar to "7zip", but this cannot be done directly via windows settings, the "7zip" is not listed in the drop-box.

So we can also set the default app via command line.

  1. Set default app for ".rar" to "7zip"
  2. Set default app for ".xml" to "nodepad++"

Steps:

  • Find where are the two applications exe files are located:
    • In the windows search menu, type "7zip", there is the "7zip file manager", right click - open file location: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\7-Zip
    • In the new folder, right click on the "7zip file manager", right - property - shortcut, and in my scenario, it shows D:\Applications\7-Zip\7zFM.exe
    • With the same steps, locate the notapad++: D:\Applications\NotePad++\notepad++.exe
  • First we can check the current default applications:
    • ftype | findstr xmlfile: xmlfile="C:\Program Files\Internet Explorer\iexplore.exe" %1
    • Run cmd as admin, run command ftype xmlfile="D:\Applications\NotePad++\notepad++.exe" "%1"
      If it succeeds, the output is: xmlfile="D:\Applications\NotePad++\notepad++.exe" "%1"
    • Check again: ftype | findstr xmlfile: xmlfile="D:\Applications\NotePad++\notepad++.exe" "%1"
    • Run the same steps for ".rar": ftype rarfile="D:\Applications\7-Zip\7zFM.exe" "%1"
      Check output: rarfile="D:\Applications\7-Zip\7zFM.exe" "%1"

And it's done.

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容