美文网首页Linux
Set windows 10 default app via f

Set windows 10 default app via f

作者: JaedenKil | 来源:发表于2022-01-23 18:59 被阅读0次

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.

相关文章

网友评论

    本文标题:Set windows 10 default app via f

    本文链接:https://www.haomeiwen.com/subject/moomhrtx.html