bat隐藏文件夹

在windows中隐藏文件是可以隐藏,但是下面红色区域一旦选中,那也就显示出来了

现在有如下代码,可以实现个性化隐藏

=======================================================

                   代码区域

=======================================================

 

@ECHO OFF
color 2
title Folder Private
color 0d
if EXIST "HTG Locker" goto UNLOCK
if NOT EXIST Private goto MDLOCKER
:CONFIRM
echo             ===================================================
echo             *                                                 *
echo             *   你确定要加密隐藏Private文件夹吗?(Y/N)            *
echo             *   Y:隐藏                                         *
echo             *   N:不隐藏                                       *
echo             *                                                 *
echo             ===================================================
set /p cho=...输入你内心最真实的想法:
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto END
if %cho%==N goto END
echo Invalid choice.
goto CONFIRM
:LOCK
ren Private "HTG Locker"
attrib +h +s "HTG Locker"
echo Folder locked
goto End
:UNLOCK
echo 输入密码来解锁文件夹
set/p "pass=>"
if NOT %pass%== 123 goto FAIL
attrib -h -s "HTG Locker"
ren "HTG Locker" Private
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md Private
echo Private created successfully
goto End
:End

 

posted @ 2016-11-30 17:48  OLIVER_QIN  阅读(2987)  评论(0编辑  收藏  举报