显示隐藏文件的批处理!

编写如下批处理:


 

新建文本文件,将以下内容另存为.BAT的文件,双击打开后即可!

注:

执行相关选项后,需刷新一下才可以看到效果,另外,批处理运行时,360安全卫士等软件可能会弹出提示,请点击确定!

@echo off

title 文件属性

:start

color 0a

cls

echo                           ------------------

echo                  --------| 1:显示所有文件  |--------

echo                  --------| 2:不显示隐藏文件 |--------

echo                  --------| 3:显示扩展名   |--------

echo                  --------| 4:不显示扩展名  |--------

echo                  --------| H.实现原理    |--------

echo                  --------| Q:退出      |--------

echo                           ------------------

echo                          设置完成后请右键-刷新

echo                           --------------------

echo            注:如果360安全卫士等软件弹出安全提示,请点击确定即可!

echo.&echo.

set /p input="请按键选择:"

if /i "%input%"=="1" (goto 1)

if /i "%input%"=="2" (goto 2)

if /i "%input%"=="3" (goto 3)

if /i "%input%"=="4" (goto 4)

if /i "%input%"=="q" (goto exit)

if /i "%input%"=="H" (goto help) else (goto start)

:1

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Hidden /t reg_dword /d 1 /f

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ShowSuperHidden /t reg_dword /d 1 /f

ping -n 2 127.0>nul

goto start

:2

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Hidden /t reg_dword /d 00000000 /f

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ShowSuperHidden /t reg_dword /d 00000000 /f

ping -n 2 127.0>nul

goto start

:3

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt /t reg_dword /d 0 /f

ping -n 2 127.0>nul

goto start

:4

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt /t reg_dword /d 00000001 /f

ping -n 2 127.0>nul

goto start

:exit

exit

:help

color 0a

mode con cols=125 lines=16

echo ------------------------------------------------------------

echo 显示所有文件:

echo reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Hidden /t reg_dword /d 1 /f

echo reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ShowSuperHidden /t reg_dword /d 1 /f

echo 不显示所有文件:

echo reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Hidden /t reg_dword /d 00000000 /f

echo reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ShowSuperHidden /t reg_dword /d 00000000 /f

echo 显示文件扩展名:

echo reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt /t reg_dword /d 0 /f

echo 不显示文件扩展名:

echo reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt /t reg_dword /d 00000001 /f

echo -----------------------------------------------------------

echo.

echo 按任意键回到选项页

pause>nul

goto start

 

 

posted @ 2013-06-01 22:48  Colin.liu  阅读(1439)  评论(0编辑  收藏  举报