|
|
楼主 |
发表于 2026-4-11 06:13:03
|
显示全部楼层
非常感谢各位老师的辛苦帮助和指导,我把10楼 J大的代码摸索着改动了一下,可以满足了要求,还请老师们看看有没有错误或修改
- @Echo off
- Reg query "HKCR\Directory\background\shell\FolderView" /v "MuiVerb"|Find "隐藏" >Nul && Goto yes || Goto no
- :yes
- Set "a=显示系统文件夹"
- Set "b=HideFolder.cmd"
- Set "icon=X:\Windows\Custom\FolderView\IcoFolder\ShowFolder.ico"
- Goto run
- :no
- Set "a=隐藏系统文件夹"
- Set "b=ShowFolder.cmd"
- Set "icon=X:\Windows\Custom\FolderView\IcoFolder\HideFolder.ico"
- :run
- Reg add "HKCR\Directory\background\shell\FolderView" /f /v "MuiVerb" /t REG_SZ /d "%a%"
- Reg add "HKCR\folder\Shell\FolderView" /f /v "MuiVerb" /t REG_SZ /d "%a%"
- Reg add "HKCR\Directory\background\shell\FolderView" /f /v "Icon" /t REG_SZ /d "%icon%"
- Reg add "HKCR\folder\Shell\FolderView" /f /v "Icon" /t REG_SZ /d "%icon%"
- Cls
- pecmd.exe EXEC !"X:\Windows\Custom\FolderView\%b%"
- If %a%==显示系统文件夹 (
- pecmd.exe MESS 已隐藏系统文件夹 @已隐藏系统文件夹 *2000
- ) else (
- pecmd.exe MESS 已显示系统文件夹 @已显示系统文件夹 *2000
- )
- pecmd.exe KILL explorer.exe
- Exit
复制代码 |
|