无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站投放广告、加入VIP会员,请联系 微信:wuyouceo
12
返回列表 发新帖
楼主: 9zhmke
打印 上一主题 下一主题

[讨论] 讨论用SetUserFTA命令行更改默认应用程序效果?

    [复制链接]
31#
发表于 2023-12-24 08:49:27 | 只看该作者
freesoft00 发表于 2023-12-18 08:26
::文件关联和协议关联
set "exe=%msedge.exe"
set "pid=msedge"
  1. :: 设置Edge为默认浏览器
  2. for %%a in (.htm .html .mht .mhtml .svg http https microsoft-edge microsoft-edge-holographic ms-xbl-3d8b930f read) do sfta.exe "MSEdgeHTM" "%%a"
  3. :: Internet Explorer
  4. sfta.exe "IE.AssocFile.URL" ".url"
  5. sfta.exe "IE.AssocFile.WEBSITE" ".website"
复制代码



一直找不到,刚找到之前研究的这段代码。
可以参考:dism /online /Export-DefaultAppAssociations

评分

参与人数 1无忧币 +5 收起 理由
freesoft00 + 5

查看全部评分

回复

使用道具 举报

32#
发表于 2024-2-7 21:44:58 | 只看该作者
正好遇到这样的问题,在这总算找到方法了。
回复

使用道具 举报

33#
发表于 2024-2-8 07:41:23 来自手机 | 只看该作者
用了下setuserfta,也挺好用的
回复

使用道具 举报

34#
发表于 2024-2-8 15:22:29 | 只看该作者
dism /online /Export-DefaultAppAssociations 和 dism /online /Import-DefaultAppAssociations 也可以试试
回复

使用道具 举报

35#
发表于 2024-2-11 15:54:56 | 只看该作者
没积分,下载不了。。。。。。。
回复

使用道具 举报

36#
发表于 2024-2-11 16:45:08 来自手机 | 只看该作者
也可以自己下源码编译sfta
回复

使用道具 举报

37#
发表于 2024-2-11 17:15:29 | 只看该作者
功能非常强大
回复

使用道具 举报

38#
发表于 2024-2-15 03:07:24 来自手机 | 只看该作者
这个很有用
回复

使用道具 举报

39#
发表于 2024-3-26 09:16:33 | 只看该作者
这个要学习试用一下。
回复

使用道具 举报

40#
发表于 2024-4-15 11:17:51 | 只看该作者
9zhmke 发表于 2023-8-21 18:30
https://github.com/DanysysTeam/SFTA/ 居然没找到下载的,百度不出来,必应下载了一个SFTA:
https://d ...

网址打不开,好奇怪啊,bing也搜不到
回复

使用道具 举报

41#
发表于 2024-5-5 22:32:22 | 只看该作者
谢谢分享,学习中
回复

使用道具 举报

42#
发表于 2024-5-27 10:19:28 | 只看该作者
样子能用,先收藏,过几天试试。
回复

使用道具 举报

43#
发表于 2024-10-21 10:47:09 | 只看该作者
9zhmke 发表于 2023-8-21 23:49
没试你那个软件,你可以参照这个PDF关联的写法:
SFTA.exe --reg "%cd%\PDFXEdit.exe" ".pdf" "PDF-XCha ...

7z压缩怎么用SFTA.exe来写关联命令
回复

使用道具 举报

44#
 楼主| 发表于 2024-10-21 13:02:49 | 只看该作者
wenbieba 发表于 2024-10-21 10:47
7z压缩怎么用SFTA.exe来写关联命令

  1. CD /D %~DP0
  2. ECHO 程序运行中,请稍等.....
  3. if defined ProgramFiles(x86) goto NEXT
  4. if not exist 32_7zFM.exe goto NEXT
  5. del 7z.dll 7z.exe 7zFM.exe 7zG.exe 7-zip.dll>nul 2>nul
  6. ren 32_7z.dll 7z.dll
  7. ren 32_7z.exe 7z.exe
  8. ren 32_7zFM.exe 7zFM.exe
  9. ren 32_7zG.exe 7zG.exe
  10. copy /y 7-zip32.dll 7-zip.dll

  11. :NEXT
  12. set p=%cd:\=\\%
  13. echo >green.reg Windows Registry Editor Version 5.00
  14. echo >>green.reg [HKEY_LOCAL_MACHINE\SOFTWARE\7-Zip]
  15. echo >>green.reg "Path"="%p%\"
  16. echo >>green.reg "Path32"="%p%\"
  17. echo >>green.reg "Path64"="%p%\"
  18. echo >>green.reg [HKEY_CURRENT_USER\Software\7-Zip]
  19. echo >>green.reg "Path32"="%p%\"
  20. echo >>green.reg "Path64"="%p%\"
  21. echo >>green.reg "Path"="%p%\"
  22. echo >>green.reg "LargePages"=dword:00000000
  23. echo >>green.reg "Lang"="zh-cn"
  24. echo >>green.reg [HKEY_CURRENT_USER\Software\7-Zip\Compression]
  25. echo >>green.reg "ShowPassword"=dword:00000000
  26. echo >>green.reg "Level"=dword:00000005
  27. echo >>green.reg "Archiver"="7z"
  28. echo >>green.reg "EncryptHeaders"=dword:00000000
  29. echo >>green.reg "ArcHistory"=hex:43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,\
  30. echo >>green.reg 20,00,46,00,69,00,6c,00,65,00,73,00,5c,00,37,00,2d,00,5a,00,69,00,70,00,5c,\
  31. echo >>green.reg 00,4c,00,61,00,6e,00,67,00,2e,00,37,00,7a,00,00,00
  32. echo >>green.reg [HKEY_CURRENT_USER\Software\7-Zip\Compression\Options]
  33. echo >>green.reg [HKEY_CURRENT_USER\Software\7-Zip\Compression\Options\7z]
  34. echo >>green.reg "Method"="LZMA2"
  35. echo >>green.reg "MemUse64"="95%%"
  36. echo >>green.reg "Level"=dword:00000009
  37. echo >>green.reg "Dictionary"=dword:20000000
  38. echo >>green.reg "Order"=dword:00000111
  39. echo >>green.reg "BlockSize"=dword:00000040
  40. echo >>green.reg "NumThreads"=dword:00000003
  41. echo >>green.reg [HKEY_CURRENT_USER\Software\7-Zip\FM]
  42. echo >>green.reg "Viewer"=""
  43. echo >>green.reg "Editor"=""
  44. echo >>green.reg "Diff"=""
  45. echo >>green.reg "ShowDots"=dword:00000000
  46. echo >>green.reg "ShowSystemMenu"=dword:00000000
  47. echo >>green.reg "ShowRealFileIcons"=dword:00000000
  48. echo >>green.reg "FullRow"=dword:00000000
  49. echo >>green.reg "ShowGrid"=dword:00000000
  50. echo >>green.reg "AlternativeSelection"=dword:00000000
  51. echo >>green.reg "SingleClick"=dword:00000000
  52. echo >>green.reg "FolderShortcuts"=hex:
  53. echo >>green.reg "FolderHistory"=hex:00,00
  54. echo >>green.reg "PanelPath0"=""
  55. echo >>green.reg "FlatViewArc0"=dword:00000000
  56. echo >>green.reg "PanelPath1"=""
  57. echo >>green.reg "FlatViewArc1"=dword:00000000
  58. echo >>green.reg "ListMode"=dword:00000303
  59. echo >>green.reg "Position"=hex:5e,01,00,00,90,01,00,00,90,03,00,00,04,03,00,00,00,00,00,00
  60. echo >>green.reg "Panels"=hex:01,00,00,00,00,00,00,00,13,01,00,00
  61. echo >>green.reg [HKEY_CURRENT_USER\Software\7-Zip\FM\Columns]
  62. echo >>green.reg "RootFolder"=hex:01,00,00,00,00,00,00,00,01,00,00,00,04,00,00,00,01,00,00,00,\
  63. echo >>green.reg a0,00,00,00
  64. echo >>green.reg [HKEY_CURRENT_USER\Software\7-Zip\Options]
  65. echo >>green.reg "CascadedMenu"=dword:00000000
  66. echo >>green.reg "MenuIcons"=dword:00000001
  67. echo >>green.reg "ContextMenu"=dword:00000367
  68. echo >>green.reg "WorkDirType"=dword:00000000
  69. echo >>green.reg "WorkDirPath"=""
  70. echo >>green.reg "TempRemovableOnly"=dword:00000001
  71. echo >>green.reg [HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\7-Zip]
  72. echo >>green.reg @="{23170F69-40C1-278A-1000-000100020000}"
  73. echo >>green.reg [HKEY_CLASSES_ROOT\CLSID\{23170F69-40C1-278A-1000-000100020000}]
  74. echo >>green.reg @="7-Zip Shell Extension"
  75. echo >>green.reg [HKEY_CLASSES_ROOT\CLSID\{23170F69-40C1-278A-1000-000100020000}\InprocServer32]
  76. echo >>green.reg @="%p%\\7-zip.dll"
  77. echo >>green.reg "ThreadingModel"="Apartment"
  78. echo >>green.reg [HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers\7-Zip]
  79. echo >>green.reg @="{23170F69-40C1-278A-1000-000100020000}"
  80. echo >>green.reg [HKEY_CLASSES_ROOT\Directory\shellex\DragDropHandlers\7-Zip]
  81. echo >>green.reg @="{23170F69-40C1-278A-1000-000100020000}"
  82. echo >>green.reg [HKEY_CLASSES_ROOT\Drive\shellex\DragDropHandlers\7-Zip]
  83. echo >>green.reg @="{23170F69-40C1-278A-1000-000100020000}"
  84. echo >>green.reg [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shellex\ContextMenuHandlers\7-Zip]
  85. echo >>green.reg @="{23170F69-40C1-278A-1000-000100020000}"
  86. echo >>green.reg [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved]
  87. echo >>green.reg "{23170F69-40C1-278A-1000-000100020000}"="7-Zip Shell Extension"
  88. echo >>green.reg [HKEY_CLASSES_ROOT\.7z]
  89. echo >>green.reg @="7-Zip.7z"
  90. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.7z]
  91. echo >>green.reg @="7z Archive"
  92. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.7z\DefaultIcon]
  93. echo >>green.reg @="%p%\\7z.dll,9"
  94. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.7z\shell]
  95. echo >>green.reg @=""
  96. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.7z\shell\open]
  97. echo >>green.reg @=""
  98. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.7z\shell\open\command]
  99. echo >>green.reg @=""%p%\\7zFM.exe" "^%%1""
  100. echo >>green.reg [HKEY_CLASSES_ROOT\.arj]
  101. echo >>green.reg @="7-Zip.arj"
  102. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.arj]
  103. echo >>green.reg @="arj Archive"
  104. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.arj\DefaultIcon]
  105. echo >>green.reg @="%p%\\7z.dll,9"
  106. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.arj\shell]
  107. echo >>green.reg @=""
  108. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.arj\shell\open]
  109. echo >>green.reg @=""
  110. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.arj\shell\open\command]
  111. echo >>green.reg @=""%p%\\7zFM.exe" "^%%1""
  112. echo >>green.reg [HKEY_CLASSES_ROOT\.cab]
  113. echo >>green.reg @="7-Zip.cab"
  114. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.cab]
  115. echo >>green.reg @="cab Archive"
  116. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.cab\DefaultIcon]
  117. echo >>green.reg @="%p%\\7z.dll,9"
  118. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.cab\shell]
  119. echo >>green.reg @=""
  120. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.cab\shell\open]
  121. echo >>green.reg @=""
  122. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.cab\shell\open\command]
  123. echo >>green.reg @=""%p%\\7zFM.exe" "^%%1""
  124. echo >>green.reg [HKEY_CLASSES_ROOT\.lha]
  125. echo >>green.reg @="7-Zip.lha"
  126. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.lha]
  127. echo >>green.reg @="lha Archive"
  128. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.lha\DefaultIcon]
  129. echo >>green.reg @="%p%\\7z.dll,9"
  130. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.lha\shell]
  131. echo >>green.reg @=""
  132. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.lha\shell\open]
  133. echo >>green.reg @=""
  134. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.lha\shell\open\command]
  135. echo >>green.reg @=""%p%\\7zFM.exe" "^%%1""
  136. echo >>green.reg [HKEY_CLASSES_ROOT\.rar]
  137. echo >>green.reg @="7-Zip.rar"
  138. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.rar]
  139. echo >>green.reg @="rar Archive"
  140. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.rar\DefaultIcon]
  141. echo >>green.reg @="%p%\\7z.dll,9"
  142. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.rar\shell]
  143. echo >>green.reg @=""
  144. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.rar\shell\open]
  145. echo >>green.reg @=""
  146. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.rar\shell\open\command]
  147. echo >>green.reg @=""%p%\\7zFM.exe" "^%%1""
  148. echo >>green.reg [HKEY_CLASSES_ROOT\.001]
  149. echo >>green.reg @="7-Zip.001"
  150. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.001]
  151. echo >>green.reg @="001 Archive"
  152. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.001\DefaultIcon]
  153. echo >>green.reg @="%p%\\7z.dll,9"
  154. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.001\shell]
  155. echo >>green.reg @=""
  156. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.001\shell\open]
  157. echo >>green.reg @=""
  158. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.001\shell\open\command]
  159. echo >>green.reg @=""%p%\\7zFM.exe" "^%%1""
  160. echo >>green.reg [HKEY_CLASSES_ROOT\.wim]
  161. echo >>green.reg @="7-Zip.wim"
  162. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.wim]
  163. echo >>green.reg @="wim Archive"
  164. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.wim\DefaultIcon]
  165. echo >>green.reg @="%p%\\7z.dll,9"
  166. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.wim\shell]
  167. echo >>green.reg @=""
  168. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.wim\shell\open]
  169. echo >>green.reg @=""
  170. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.wim\shell\open\command]
  171. echo >>green.reg @=""%p%\\7zFM.exe" "^%%1""
  172. echo >>green.reg
  173. echo >>green.reg [HKEY_CLASSES_ROOT\.zip]
  174. echo >>green.reg @="7-Zip.zip"
  175. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.zip]
  176. echo >>green.reg @="zip Archive"
  177. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.zip\DefaultIcon]
  178. echo >>green.reg @="%p%\\7z.dll,9"
  179. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.zip\shell]
  180. echo >>green.reg @=""
  181. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.zip\shell\open]
  182. echo >>green.reg @=""
  183. echo >>green.reg [HKEY_CLASSES_ROOT\7-Zip.zip\shell\open\command]
  184. echo >>green.reg @=""%p%\\7zFM.exe" "^%%1""
  185. :BEGIN
  186. regedit /s green.reg
  187. del green.reg 2>nul

  188. :EXIT

复制代码


点评

用SFTA.exe来写  详情 回复 发表于 2024-10-21 19:22
回复

使用道具 举报

45#
发表于 2024-10-21 19:22:12 | 只看该作者
回复

使用道具 举报

46#
 楼主| 发表于 2024-10-22 09:35:27 | 只看该作者
本帖最后由 9zhmke 于 2024-10-22 09:37 编辑
大约是这样,没调试,不确定。你自己再改改
  1. pushd "%~dp0"
  2. set file=7z,rar,zip,arc
  3. set "exe=7zFM.exe"
  4. set "pid=7-Zip"
  5. :BEGIN
  6. setlocal enabledelayedexpansion
  7. ::允许防火墙入站规则
  8. netsh advfirewall firewall add rule name="%pid%" dir=in action=allow program="%~dp0%exe%" >NUL 2>NUL

  9. for %%i in (%file%) do SFTA.exe --reg "%cd%\%exe%" ".%%i" "%pid%"
复制代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-11-24 06:18

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表