Thursday, 26 December 2013

Batch file program to password protect a folder.



Here's a batch file code which helps you to password protect any of your directory/folder.
It simply makes your folder kind of a path to control panel and hides it.
Even if it is found, it wont be regonized because it will say control panel and on double clicking it, it will simply open control panel.

All you got to do is paste the following code as it is in a text file and save it with batch extension
[for e.g Folder.bat].
now double click on it, it will create a folder named "Locker".
save any thing you want in the folder and when your done, double click again on the batch file.
It will make the folder disappear.
Again to unlock it just double click again on the same batch file.
It will ask for the password.
The default password is cyberboot.[shown below in yellow]
You can replace it with whatever you want.

@ECHO OFF
title Cyber~boot : Folder locker
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Locker goto MDLOCKER
:CONFIRM
echo Are you sure u 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 Locker "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%==cyberboot goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Locker
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md Locker
echo Locker created successfully
goto End
:End

No comments:

Post a Comment

Popular Posts