无忧启动论坛

标题: 自己需要自己写,顺带给大家共享共享。Show&Hide System File [打印本页]

作者: brave_boy    时间: 2010-1-4 23:34
标题: 自己需要自己写,顺带给大家共享共享。Show&Hide System File
@echo off
color 5f
title Show\Hide System File
:选择
cls
echo.
echo  -----------------------------------------------------------------------------
echo.
echo   1 、 Windows 7 安装
echo.
echo   2 、 Windows 2K-XP-2K3 安装
echo.
echo.
echo   3 、 Windows 7 卸载
echo.
echo   4 、 Windows 2K-XP-2K3 卸载
echo.
echo  -----------------------------------------------------------------------------
echo.
set Choice=1
set /p Choice= 输入(直接回车选1):
if /i '%Choice%'=='1' goto w7
if /i '%Choice%'=='2' goto 2k-xp-2k3
if /i '%Choice%'=='3' goto w7-uninstall
if /i '%Choice%'=='4' goto 2k-xp-2k3-uninstall
cls
echo.
echo  '%Choice%' 是错误的选择。
echo.
echo  请输入 1~4 然后确定。
echo.
ping localhost -n 3 >nul
goto 选择

:w7
cls
title Windows 7 Install
echo 'Show/Hide System Files by [email=@yahoo.cn]@yahoo.cn>>"%tmp%\SuperHidden.vbs[/email]"
echo.>>"%tmp%\SuperHidden.vbs"
echo Dim WSHShell>>"%tmp%\SuperHidden.vbs"
echo Set WSHShell = WScript.CreateObject("WScript.Shell")>>"%tmp%\SuperHidden.vbs"
echo.>>"%tmp%\SuperHidden.vbs"
echo if WSHShell.RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden") = 2 then>>"%tmp%\SuperHidden.vbs"
echo.>>"%tmp%\SuperHidden.vbs"
echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideDrivesWithNoMedia", "0", "REG_DWORD">>"%tmp%\SuperHidden.vbs"
echo '↑*【隐藏计算机文件夹中的空驱动器】不勾选>>"%tmp%\SuperHidden.vbs"
echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden", "1", "REG_DWORD">>"%tmp%\SuperHidden.vbs"
echo '↑*【隐藏受保护的操作系统文件(推荐)】不勾选>>"%tmp%\SuperHidden.vbs"
echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden", "1", "REG_DWORD">>"%tmp%\SuperHidden.vbs"
echo '↑-【显示隐藏的文件、文件夹或驱动器】选择>>"%tmp%\SuperHidden.vbs"
echo WSHShell.RegWrite "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag\command", "隐藏系统文件<<", "REG_SZ">>"%tmp%\SuperHidden.vbs"
echo '>>"%tmp%\SuperHidden.vbs"
echo WSHShell.SendKeys "{F5}">>"%tmp%\SuperHidden.vbs"
echo.>>"%tmp%\SuperHidden.vbs"
echo else>>"%tmp%\SuperHidden.vbs"
echo.>>"%tmp%\SuperHidden.vbs"
echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideDrivesWithNoMedia", "1", "REG_DWORD">>"%tmp%\SuperHidden.vbs"
echo '↑*【隐藏计算机文件夹中的空驱动器】勾选>>"%tmp%\SuperHidden.vbs"
echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden", "0", "REG_DWORD">>"%tmp%\SuperHidden.vbs"
echo '↑*【隐藏受保护的操作系统文件(推荐)】勾选 >>"%tmp%\SuperHidden.vbs"
echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden", "2", "REG_DWORD">>"%tmp%\SuperHidden.vbs"
echo '↑-【不显示隐藏的文件、文件夹或驱动器】选择>>"%tmp%\SuperHidden.vbs"
echo WSHShell.RegWrite "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag\command", "显示系统文件<<", "REG_SZ">>"%tmp%\SuperHidden.vbs"
echo '>>"%tmp%\SuperHidden.vbs"
echo WSHShell.SendKeys "{F5}">>"%tmp%\SuperHidden.vbs"
echo.>>"%tmp%\SuperHidden.vbs"
echo end if>>"%tmp%\SuperHidden.vbs"
echo.>>"%tmp%\SuperHidden.vbs"
echo Set WSHShell = Nothing>>"%tmp%\SuperHidden.vbs"
echo WScript.Quit(0)>>"%tmp%\SuperHidden.vbs"
copy /y "%tmp%\SuperHidden.vbs" %SystemRoot% 1>nul 2>nul
reg add "HKCR\Directory\Background\shellex\ContextMenuHandlers\SuperHidden" /f /ve /t REG_SZ /d "{00000000-0000-0000-0000-000000000012}"
reg add "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\InProcServer32" /f /ve /t REG_EXPAND_SZ /d "%SystemRoot%\system32\shdocvw.dll"
reg add "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\InProcServer32" /f /v "ThreadingModel" /t REG_SZ /d "Apartment"
reg add "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\Instance" /f /v "CLSID" /t REG_SZ /d "{3f454f0e-42ae-4d7c-8ea3-328250d6e272}"
reg add "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag" /f /v "method" /t REG_SZ /d "ShellExecute"
reg add "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag" /f /v "Param1" /t REG_SZ /d "SuperHidden.vbs"
reg add "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag" /f /v "command" /t REG_SZ /d "隐藏系统文件<<"
reg add "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag" /f /v "CLSID" /t REG_SZ /d "{13709620-C279-11CE-A49E-444553540000}"
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /f /v "Hidden" /t REG_DWORD /d 1
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /f /v "HideFileExt" /t REG_DWORD /d 0
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /f /v "HideDrivesWithNoMedia" /t REG_DWORD /d 0
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /f /v "ShowSuperHidden" /t REG_DWORD /d 1
del /q "%tmp%\SuperHidden.vbs" 1>nul 2>nul
echo.
echo.
echo  安装成功,并且更改为显示系统文件。
echo.
pause
>%tmp%\Refresh.vbs echo WScript.CreateObject("WScript.Shell").SendKeys "{F5}"
start %tmp%\Refresh.vbs
exit

:2k-xp-2k3
cls
title Windows 2K-XP-2K3 Install
echo 'Show/Hide System Files by [email=@yahoo.cn]@yahoo.cn>>"%tmp%\SuperHidden.vbs[/email]"
echo.>>"%tmp%\SuperHidden.vbs"
echo Dim WSHShell>>"%tmp%\SuperHidden.vbs"
echo Set WSHShell = WScript.CreateObject("WScript.Shell")>>"%tmp%\SuperHidden.vbs"
echo.>>"%tmp%\SuperHidden.vbs"
echo if WSHShell.RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden") = 2 then>>"%tmp%\SuperHidden.vbs"
echo.>>"%tmp%\SuperHidden.vbs"
echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\WebViewBarricade", "1", "REG_DWORD">>"%tmp%\SuperHidden.vbs"
echo '↑【显示系统文件夹的内容】  勾选>>"%tmp%\SuperHidden.vbs"
echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden", "1", "REG_DWORD">>"%tmp%\SuperHidden.vbs"
echo '↑【隐藏受保护的操作系统文件(推荐)】  不勾选>>"%tmp%\SuperHidden.vbs"
echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden", "1", "REG_DWORD">>"%tmp%\SuperHidden.vbs"
echo '↑【显示所有文件和文件夹】>>"%tmp%\SuperHidden.vbs"
echo WSHShell.RegWrite "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag\command", "隐藏系统文件<<", "REG_SZ">>"%tmp%\SuperHidden.vbs"
echo '↑【修改菜单显示名】>>"%tmp%\SuperHidden.vbs"
echo WSHShell.SendKeys "{F5}+{F10}e">>"%tmp%\SuperHidden.vbs"
echo.>>"%tmp%\SuperHidden.vbs"
echo else>>"%tmp%\SuperHidden.vbs"
echo.>>"%tmp%\SuperHidden.vbs"
echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\WebViewBarricade", "0", "REG_DWORD">>"%tmp%\SuperHidden.vbs"
echo '↑【显示系统文件夹的内容】  不勾选>>"%tmp%\SuperHidden.vbs"
echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden", "0", "REG_DWORD">>"%tmp%\SuperHidden.vbs"
echo '↑【隐藏受保护的操作系统文件(推荐)】  勾选>>"%tmp%\SuperHidden.vbs"
echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden", "2", "REG_DWORD">>"%tmp%\SuperHidden.vbs"
echo '↑【不显示隐藏的文件和文件夹】>>"%tmp%\SuperHidden.vbs"
echo WSHShell.RegWrite "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag\command", "显示系统文件<<", "REG_SZ">>"%tmp%\SuperHidden.vbs"
echo '↑【修改菜单显示名】>>"%tmp%\SuperHidden.vbs"
echo WSHShell.SendKeys "{F5}+{F10}e">>"%tmp%\SuperHidden.vbs"
echo.>>"%tmp%\SuperHidden.vbs"
echo end if>>"%tmp%\SuperHidden.vbs"
echo.>>"%tmp%\SuperHidden.vbs"
echo Set WSHShell = Nothing>>"%tmp%\SuperHidden.vbs"
echo WScript.Quit(0)>>"%tmp%\SuperHidden.vbs"
copy /y "%tmp%\SuperHidden.vbs" %SystemRoot% 1>nul 2>nul
reg add "HKCR\Directory\Background\shellex\ContextMenuHandlers\SuperHidden" /f /ve /t REG_SZ /d "{00000000-0000-0000-0000-000000000012}"
reg add "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\InProcServer32" /f /ve /t REG_EXPAND_SZ /d "%SystemRoot%\system32\shdocvw.dll"
reg add "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\InProcServer32" /f /v "ThreadingModel" /t REG_SZ /d "Apartment"
reg add "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\Instance" /f /v "CLSID" /t REG_SZ /d "{3f454f0e-42ae-4d7c-8ea3-328250d6e272}"
reg add "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag" /f /v "method" /t REG_SZ /d "ShellExecute"
reg add "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag" /f /v "Param1" /t REG_SZ /d "SuperHidden.vbs"
reg add "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag" /f /v "command" /t REG_SZ /d "隐藏系统文件<<"
reg add "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag" /f /v "CLSID" /t REG_SZ /d "{13709620-C279-11CE-A49E-444553540000}"
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /f /v "Hidden" /t REG_DWORD /d 1
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /f /v "WebViewBarricade" /t REG_DWORD /d 1
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /f /v "ShowSuperHidden" /t REG_DWORD /d 1
del /q "%tmp%\SuperHidden.vbs" 1>nul 2>nul
echo.
echo.
echo  安装成功,并且更改为显示系统文件。
echo.
pause
>%tmp%\Refresh.vbs echo WScript.CreateObject("WScript.Shell").SendKeys "{F5}+{F10}e"
start %tmp%\Refresh.vbs
exit

:w7-uninstall
cls
title Windows 7 Uninstall
del /q %SystemRoot%\SuperHidden.vbs 1>nul 2>nul
reg delete "HKCR\Directory\Background\shellex\ContextMenuHandlers\SuperHidden" /f
reg delete "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /f /v "Hidden" /t REG_DWORD /d 2
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /f /v "HideDrivesWithNoMedia" /t REG_DWORD /d 1
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /f /v "ShowSuperHidden" /t REG_DWORD /d 0
echo.
echo.
echo  卸载成功,并且更改为隐藏系统文件与扩展名。
echo.
pause
>%tmp%\Refresh.vbs echo WScript.CreateObject("WScript.Shell").SendKeys "{F5}"
start %tmp%\Refresh.vbs
exit
:2k-xp-2k3-uninstall
cls
title Windows 2K-XP-2K3 Uninstall
del /q %SystemRoot%\SuperHidden.vbs 1>nul 2>nul
reg delete "HKCR\Directory\Background\shellex\ContextMenuHandlers\SuperHidden" /f
reg delete "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /f /v "Hidden" /t REG_DWORD /d 2
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /f /v "WebViewBarricade" /t REG_DWORD /d 0
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /f /v "ShowSuperHidden" /t REG_DWORD /d 0
echo.
echo.
echo  卸载成功,并且更改为隐藏系统文件与扩展名。
echo.
pause
>%tmp%\Refresh.vbs echo WScript.CreateObject("WScript.Shell").SendKeys "{F5}+{F10}e"
start %tmp%\Refresh.vbs
exit






我在WINDOWS7下试了正常,谁XP下试试好不好用。

[ 本帖最后由 brave_boy 于 2011-7-25 13:31 编辑 ]
作者: dlwfdlikuan    时间: 2010-1-5 10:22
支持楼主了,总算做了沙发!
作者: jxf268    时间: 2010-1-5 15:11
随便写了一个需要PECMD支持的,另存为SuperHidden.wcs即可,右键菜单没写,我喜欢用热键调用执行。

//显示&隐藏文件及扩展名
ENVI Adv=HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
REGI #%Adv%\ShowSuperHidden,RegDat
FIND $%RegDat%=0x00000000,call 显示!call 隐藏

_SUB 隐藏
REGI %Adv%\ShowSuperHidden=#0
REGI %Adv%\Hidden=#2
TEAM REGI %Adv%\HideFileExt=#1|SEND #116,#93,E \\#116=F5,#93=MEMU就是徽标与右Ctrl中间的那个健
_END

_SUB 显示
REGI HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\SHOWALL\CheckedValue=#1
REGI %Adv%\ShowSuperHidden=#1
REGI %Adv%\Hidden=#1
TEAM REGI %Adv%\HideFileExt=#0|SEND #116,#93,E
_END

[ 本帖最后由 jxf268 于 2010-1-5 15:14 编辑 ]
作者: zxw    时间: 2010-1-6 09:29
用vbs写了一个,XP/PE自己测试均可用。

Dim WshShell,SysDir,VbsPath
  set WshShell = WScript.CreateObject("WScript.shell")
  SysRootDir = WshShell.ExpandEnvironmentStrings("%windir%")&"\system32\"
  VbsPath=left(Wscript.ScriptFullName,len(Wscript.ScriptFullName)-len(Wscript.ScriptName))
  StrShow = "显示系统文件+扩展名"
  StrHide = "隐藏系统文件+扩展名"
  StrReg = "{bd7ef628-3459-45d0-b81e-f11a4f58c2a3}"
  DirReg0 = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden"
  DirReg1 = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden"
  DirReg2 = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt"
  DirReg3 = "HKLM\SOFTWARE\Classes\CLSID\"&StrReg
  DirReg4 = "HKCR\Directory\Background\shellex\ContextMenuHandlers\SuperHidden"
if VbsPath = SysRootDir Then
    ShoworHide
  else
    Setupvbs
end if
Function ShoworHide( )
  if WSHShell.RegRead(DirReg1) = 1 Then
    WSHShell.RegWrite DirReg0, "0", "REG_DWORD"
    WSHShell.RegWrite DirReg1, "2", "REG_DWORD"
    WSHShell.RegWrite DirReg2, "1", "REG_DWORD"
    WshShell.RegWrite DirReg3&"\Instance\InitPropertyBag\command", StrShow, "REG_SZ"
    WshShell.SendKeys "{F5}+{F10}e"
  else
    WSHShell.RegWrite DirReg0, "1", "REG_DWORD"
    WSHShell.RegWrite DirReg1, "1", "REG_DWORD"
    WSHShell.RegWrite DirReg2, "0", "REG_DWORD"
    WshShell.RegWrite DirReg3&"\Instance\InitPropertyBag\command", StrHide, "REG_SZ"
    WshShell.SendKeys "{F5}+{F10}e"
  end if
  Set WSHShell = Nothing
  WScript.Quit(0)
End Function
Function Setupvbs( )
  if WSHShell.RegRead(DirReg1) = 2 Then
    StrShow1 = StrShow
    else StrShow1 = StrHide
  end if
  intAnswer = MsgBox("【是】将“显示/隐藏系统文件+扩展名”加入到右键菜单。 "&Chr(10)&Chr(10)&"【否】将“显示/隐藏系统文件+扩展名”从右键菜单删除。 "&Chr(10)&Chr(10)&"【取消】将直接“"&StrShow1&"”并退出。 ", vbQuestion + vbYesNoCancel, "显示/隐藏系统文件+扩展名")
  If intAnswer = vbYes Then
    WshShell.RegWrite  DirReg4&"\",StrReg,"REG_SZ"
    WshShell.RegWrite DirReg3&"\InProcServer32\",SysRootDir&"shdocvw.dll" ,"REG_EXPAND_SZ"
    WshShell.RegWrite DirReg3&"\InProcServer32\ThreadingModel","Apartment","REG_SZ"
    WshShell.RegWrite DirReg3&"\Instance\CLSID","{3f454f0e-42ae-4d7c-8ea3-328250d6e272}","REG_SZ"
    WshShell.RegWrite DirReg3&"\Instance\InitPropertyBag\CLSID","{13709620-C279-11CE-A49E-444553540000}","REG_SZ"
    WshShell.RegWrite DirReg3&"\Instance\InitPropertyBag\command",StrShow1,"REG_SZ"
    WshShell.RegWrite DirReg3&"\Instance\InitPropertyBag\method","ShellExecute","REG_SZ"
    WshShell.RegWrite DirReg3&"\Instance\InitPropertyBag\Param1",SysRootDir&"ShoworHide.vbs","REG_SZ"
    set copy1=createobject("scripting.filesystemobject")
    copy1.getfile(wscript.scriptfullname).copy SysRootDir&"ShoworHide.vbs",true
  end if
  If intAnswer = vbNo Then
    WshShell.Run "cmd /c reg delete "&DirReg3&" /f",vbhide
    WshShell.Run "cmd /c reg delete "&DirReg4&" /f",vbhide
    WshShell.Run "cmd /c reg delete "&DirReg0&" /v ShowSuperHidden /f",vbhide
    WshShell.Run "cmd /c DEL /F /AS /Q "&SysRootDir&"ShoworHide.vbs",vbhide
  end if
  If intAnswer = vbCancel Then
    ShoworHide
  end if
  Set WSHShell = Nothing
  WScript.Quit(0)
End Function
作者: keetle    时间: 2010-1-8 11:42
一头雾水,以上代码干嘛用的?
作者: thy850    时间: 2010-1-8 22:36
4楼的很好用啊。。谢谢
作者: brave_boy    时间: 2010-1-9 17:17
WIN7适用否?俺用win7的
作者: 大少爷    时间: 2010-1-10 14:57
顶楼的xp没效果.

4楼的不错.3楼的快捷键是什么?
作者: 135956    时间: 2010-1-11 13:52
不错,看看,建议楼主来些说明,不然,都不知是什么。。。




欢迎光临 无忧启动论坛 (http://wuyou.net/) Powered by Discuz! X3.3