Board logo

标题: [注册表类] 批处理修改注册表显隐文件+扩展名 [打印本页]

作者: smss    时间: 2018-12-21 22:48     标题: 批处理修改注册表显隐文件+扩展名

  1. ::WIN11一键切换经典或新式右键
  2. reg delete "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}" /f||(reg add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /ve /d "" /f&taskkill /f /im explorer.exe&start explorer.exe)
复制代码
  1. ::显隐文件+扩展名(另存为ANSI编码bat脚本运行 否则乱码 再次运行即可删除)
  2. @Echo off&%1 start "" mshta vbscript:createobject("shell.application").shellexecute("""%~0""","::",,"runas",1)(window.close)&exit
  3. if exist %Windir%\SuperHidden.vbs del /f/q %Windir%\SuperHidden.vbs>nul&reg delete "HKCR\Directory\Background\shell\InitPropertyBag" /f>nul&echo 卸除完毕!&ping 0 -n "2">nul&exit
  4. (echo Set WSHShell = WScript.CreateObject^("WScript.Shell"^)
  5. echo if WSHShell.RegRead^("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden"^) = 1 then
  6. echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden", "0", "REG_DWORD"
  7. echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden", "2", "REG_DWORD"
  8. echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt", "1", "REG_DWORD"
  9. echo WSHShell.RegWrite "HKCR\Directory\Background\shell\InitPropertyBag\MUIVerb", "显示文件+扩展名", "REG_SZ"
  10. echo WSHShell.RegWrite "HKCR\Directory\Background\shell\InitPropertyBag\Icon", "imageres.dll,9", "REG_SZ"
  11. echo else
  12. echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden", "1", "REG_DWORD"
  13. echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden", "1", "REG_DWORD"
  14. echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt", "0", "REG_DWORD"
  15. echo WSHShell.RegWrite "HKCR\Directory\Background\shell\InitPropertyBag\MUIVerb", "隐藏文件+扩展名", "REG_SZ"
  16. echo WSHShell.RegWrite "HKCR\Directory\Background\shell\InitPropertyBag\Icon", "imageres.dll,8", "REG_SZ"
  17. echo end if
  18. echo WSHShell.SendKeys "{F5}")>%Windir%\SuperHidden.vbs
  19. for /f "tokens=1,2,* " %%i in ('reg query "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt')do if %%k==0x1 (set x=9&set y=显示)else set x=8&set y=隐藏
  20. (reg add "HKCR\Directory\Background\shell\InitPropertyBag" /v "MUIVerb" /t REG_SZ /d "%y%文件+扩展名" /f&reg add "HKCR\Directory\Background\shell\InitPropertyBag" /f /v "Icon" /t REG_SZ /d "imageres.dll,%x%"&reg add "HKCR\Directory\Background\shell\InitPropertyBag\Command" /t REG_SZ /d "%Windir%\System32\WScript.exe %windir%\SuperHidden.vbs" /f)>nul&echo 安装完毕!&ping 0 -n "2">nul&exit
复制代码

作者: Batcher    时间: 2018-12-22 10:19

感谢分享。
我是 Total Commander 用户,把 cm_SwitchHidSys 放到菜单栏,显示/隐藏系统文件一键切换。
作者: 窄口牛    时间: 2019-2-18 08:02

vbs权限不够,修改注册表权限试试。
作者: xczxczxcz    时间: 2019-4-11 17:29

既然WIN10就少用BAT了,眼晕。
作者: sofood    时间: 2019-12-1 23:04

感谢smss分享!
对新版win10右键中文支持不好,出现乱码,怎么修正?
作者: anythingsky    时间: 2022-1-28 13:04

再写一个 WIN 11 的 ,谢谢,最后 在第一层右击菜单




欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2