、然后打开该文件夹,然后在窗口空白处右击鼠标选择“新建→ 文本文档”命令创建一个文本文件;
3、将以下代码复制到刚才新建的文本文件中:
cls
@ECHO OFF
title Folder Private
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Private goto MDLOCKER
:CONFIRM
echo Are you sure you want to lock the folder(Y/N)
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 "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Folder locked
goto End
:UNLOCK
echo Enter password to unlock folder
set/p "pass=>"
if NOT %pass%== PASSWORD_GOES_HERE goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Private
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md Private
echo Private created successfully
goto End
:End
4、在上面的代码中,用自己想要的密码取代“PASSWORD_GOES_HERE”,比如:用12345,最后的效果是:if NOT %pass%== 12345 goto FAIL;
5、然后将文本文件另存为.bat格式,文件名可以定为“locker.bat”,提醒,保存类型设置为“所有文件”才能保存成功;
6、然后双击“locker.bat”文件,在“隐藏文件”文件夹中建立一个名为“Private”的文件夹,你可以将任何需要隐藏的文件放置到该文件夹;
7、再次双击“Locker.bat”文件可以让“Private”文件夹中的内容消失,在出现的命令提示符窗口输入"Y",回车即可;这时,我们发现该文件夹隐身了;