Monday 31 October 2011

Lock your folder without any software

In my previous post, I shared how to hide and password protect using free hide folder software which can be downloaded from here. In this post, I want to share how we can lock and password protect with notepad.

Open Notepad and copy and paste the following lines of code exactly.
cls
:End
@ECHO OFF
title 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%==tenraj 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


In the above batch code(line in red), password has been set as tenraj. Replace it with your won password.

Now click on 'save as' to save this notepad file as xyz.bat ,here .bat is extension of your file so you should not forget it. I am keeping my file name as folderlock.bat.

Now your bat(system) file is created.

Double Click on this .bat file and you will see a Locker Folder at the same location where your .bat file is saved. You will also see a pop up window. Just close it as of now.

Now next thing you will have to do is copy and paste the files and folders you want to lock into the folder named locker. So copy the files you want to hide or lock and then double click on locker folder and paste. Files you copied will be saved in locker folder. Close the locker folder after copying is done.

In the next step double click on your bat file. The window will pop up with questions,"are you sure you want to lock the folder(Y/N). Type "y " and enter. A message "Folder locked" will appear. Your folder will be successfully locked and hidden. You can close the window now.

To to unlock the folder, double click on bat file and then enter the password. You can then have access to your folder. Lock it and unlock it as and when you want. If you want you can replace those lines in blue in the above code with your own comfortable lines.

Click here for more computer tricks.

No comments:

Post a Comment