|
|
楼主 |
发表于 2026-4-10 09:54:56
|
显示全部楼层
- Dim WSHShell
- Set WSHShell = WScript.CreateObject("WScript.Shell")
- ' 读取当前隐藏状态
- if WSHShell.RegRead("HKCR\Directory\background\shell\FolderView\MuiVerb") = "显示系统文件夹" then
- ' 若当前为显示系统文件夹,则设置为隐藏系统文件夹
- WSHShell.Run "X:\Windows\Custom\FolderView\ShowFolder.cmd", 0, True
- WSHShell.RegWrite "HKCR\Directory\background\shell\FolderView\MuiVerb", "隐藏系统文件夹","REG_SZ"
- WSHShell.RegWrite "HKCR\folder\Shell\FolderView\MuiVerb", "隐藏系统文件夹","REG_SZ"
- WSHShell.RegWrite "HKCR\Directory\background\shell\FolderView\Icon", "X:\Windows\Custom\FolderView\IcoFolder\HideFolder.ico","REG_SZ"
- WSHShell.RegWrite "HKCR\folder\Shell\FolderView\Icon", "X:\Windows\Custom\FolderView\IcoFolder\HideFolder.ico","REG_SZ"
- WSHShell.Popup "已显示文件系统文件夹", 1, "操作成功", vbFolderView
- ' 刷新资源管理器
- WSHShell.SendKeys "{F5}+{F10}e"
- Set WSHShell = Nothing
- else
- ' 若当前显示为隐藏系统文件夹,则设置为显示系统文件夹
- WSHShell.Run "X:\Windows\Custom\FolderView\HideFolder.cmd", 0, True
- WSHShell.RegWrite "HKCR\Directory\background\shell\FolderView\MuiVerb", "显示系统文件夹","REG_SZ"
- WSHShell.RegWrite "HKCR\folder\Shell\FolderView\MuiVerb", "显示系统文件夹","REG_SZ"
- WSHShell.RegWrite "HKCR\Directory\background\shell\FolderView\Icon", "X:\Windows\Custom\FolderView\IcoFolder\ShowFolder.ico","REG_SZ"
- WSHShell.RegWrite "HKCR\folder\Shell\FolderView\Icon", "X:\Windows\Custom\FolderView\IcoFolder\ShowFolder.ico","REG_SZ"
- WSHShell.Popup "已隐藏文件系统文件夹", 1, "操作成功", vbFolderView
- ' 刷新资源管理器
- WSHShell.SendKeys "{F5}+{F10}e"
- Set WSHShell = Nothing
- end if
复制代码 |
|