给win7/win8添加右键显示/隐藏文件选项
在用win7的时候,一直就用着网上流传的右键显示/隐藏文件选项的代码,只要单击右键即可快速的显示或者隐藏文件扩展名/隐藏的文件,对于我来说真的是一大方便呀。开始换到win8之后,这个代码就再也不管用了,各种原因我就不懂了,直到昨天才从网上找到了新的方法,在这里就分享下吧!
win7(复制下面代码到记事本,命名为bat格式文件)
- @echo off
- mode con cols=41 lines=4
- title 右键菜单 显示/隐藏扩展名及文件
- color 0b
- if not exist "%windir%\SuperHidden.vbs" goto setup
- reg delete "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}" /f >nul 2>nul
- del /f /q "%windir%\SuperHidden.vbs" >nul 2>nul
- echo.&echo 卸除完毕。
- pause>nul
- exit
- :setup
- color 0a
- >"%windir%\SuperHidden.vbs" echo Dim WSHShell
- >>"%windir%\SuperHidden.vbs" echo Set WSHShell = WScript.CreateObject("WScript.Shell")
- >>"%windir%\SuperHidden.vbs" echo WSHShell.RegWrite "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag\CLSID", "{13709620-C279-11CE-A49E-444553540000}", "REG_SZ"
- >>"%windir%\SuperHidden.vbs" echo WSHShell.RegWrite "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag\method", "ShellExecute", "REG_SZ"
- >>"%windir%\SuperHidden.vbs" echo if WSHShell.RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt") = 0 then
- >>"%windir%\SuperHidden.vbs" echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden", "0", "REG_DWORD"
- >>"%windir%\SuperHidden.vbs" echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden", "2", "REG_DWORD"
- >>"%windir%\SuperHidden.vbs" echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt", "1", "REG_DWORD"
- >>"%windir%\SuperHidden.vbs" echo WSHShell.RegWrite "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag\command", "===系统===", "REG_SZ"
- >>"%windir%\SuperHidden.vbs" echo WSHShell.SendKeys "{F5}+{F10}e"
- >>"%windir%\SuperHidden.vbs" echo else
- >>"%windir%\SuperHidden.vbs" echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden", "1", "REG_DWORD"
- >>"%windir%\SuperHidden.vbs" echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden", "1", "REG_DWORD"
- >>"%windir%\SuperHidden.vbs" echo WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt", "0", "REG_DWORD"
- >>"%windir%\SuperHidden.vbs" echo WSHShell.RegWrite "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag\command", "===隐藏===", "REG_SZ"
- >>"%windir%\SuperHidden.vbs" echo WSHShell.SendKeys "{F5}+{F10}e"
- >>"%windir%\SuperHidden.vbs" echo end if
- >>"%windir%\SuperHidden.vbs" echo Set WSHShell = Nothing
- >>"%windir%\SuperHidden.vbs" echo WScript.Quit(0)
- reg export "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "%temp%\__.reg" >nul
- for /f "tokens=2 delims==" %%. in ('find/i "HideFileExt" "%temp%\__.reg"') do set v=%%~.
- del "%temp%\__.reg"
- set v=%v:~-1%
- if %v% equ 0 set vv====系统===
- if %v% equ 1 set vv====隐藏===
- >"%temp%\_.reg" echo REGEDIT4
- >>"%temp%\_.reg" echo [HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\SuperHidden]
- >>"%temp%\_.reg" echo @="{00000000-0000-0000-0000-000000000012}"
- >>"%temp%\_.reg" echo [HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-000000000012}\InProcServer32]
- >>"%temp%\_.reg" echo @=hex(2):25,53,79,73,74,65,6d,52,6f,6f,74,25,5c,73,79,73,74,65,6d,33,32,5c,73,\
- >>"%temp%\_.reg" echo 68,64,6f,63,76,77,2e,64,6c,6c,00
- >>"%temp%\_.reg" echo "ThreadingModel"="Apartment"
- >>"%temp%\_.reg" echo [HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-000000000012}\Instance]
- >>"%temp%\_.reg" echo "CLSID"="{3f454f0e-42ae-4d7c-8ea3-328250d6e272}"
- >>"%temp%\_.reg" echo [HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag]
- >>"%temp%\_.reg" echo "method"="ShellExecute"
- >>"%temp%\_.reg" echo "Param1"="SuperHidden.vbs"
- >>"%temp%\_.reg" echo "CLSID"="{13709620-C279-11CE-A49E-444553540000}"
- >>"%temp%\_.reg" echo "command"="%vv%"
- regedit /s "%temp%\_.reg"
- del /f /q "%temp%\_.reg"
- echo.&echo 已添加右键 %vv% 。
- pause>nul
- exit
win8(新建一个空白记事本文档,复制下面代码:注意本人喜欢把右键菜单写成“Reflash All ”大家可以直接修改里面的“Reflash All”为自己想在 右键菜单显示的 菜单名称比如“显示/隐藏文件”。保存reg文件)
- Windows Registry Editor Version 5.00
- [HKEY_CLASSES_ROOT\Directory\Background\shell\SuperHidden]
- @="Reflash All"
- [HKEY_CLASSES_ROOT\Directory\Background\shell\SuperHidden\Command]
- @="WScript.exe C:\\windows\\SuperHidden.vbs"
- [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
- "ShowSuperHidden"=dword:00000000
- "Hidden"=dword:00000002
再新建一个空白文档,复制一下代码:保存为SuperHidden.vbs 注意这个名字不要随意修改了。然后把这个文件复制到C:/Windows/目录下。
- Dim WSHShell
- Set WSHShell = WScript.CreateObject("WScript.Shell")
- sTitle1 = "SSH=0"
- sTitle2 = "SSH=1"
- if WSHShell.RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden") = 1 then
- WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden", "0", "REG_DWORD"
- WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden", "2", "REG_DWORD"
- WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt", "1", "REG_DWORD"
- WSHShell.SendKeys "{F5}"
- else
- WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden", "1", "REG_DWORD"
- WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden", "1", "REG_DWORD"
- WSHShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt", "0", "REG_DWORD"
- WSHShell.SendKeys "{F5}"
- end if
- Set WSHShell = Nothing
- WScript.Quit(0)
这一步搞定后,运行上面的reg文件就搞定拉,然后回到桌面上,右键鼠标看下有没有Reflash All这个选项吧!搞定收工!
呀,搬回wp了啊
是呀 搬回来了
呀,吓我一跳,以为点点做优化了,开起来这么快,原来你也搬到wp上了呀。可是。。你是怎么做的呀,点击点点上的链接跳到你的主机上呀?
同步更新而已
请问。。
什么事?
欢迎回到WP大家庭 =。=
我终于又回来了…
好喜欢这里的内容,详细而专业,谢谢,支持了
话说这个不能乱用,一不小心隐藏的文件就给人看到了! :o
把那个字符换成别的不就行了。。。而且 俺也没不可告人的秘密。。。这个还是挺实用的
可以与博客交换友情链接吗?www.lyblog.net
原来有个superhidden的小软件,安装后也是会生成几个文件VBS bat什么的,估计内容差不多。
估计是 他做出软件版