How to password protect files and folders on Windows 7 and 8?

Desktops Tutorials
How-to-password-protect-files-on-Windows-7-and-8

Password protection is really important when it comes to personal and private documents, which are meant not to be shared with anyone using your computer. You can protect files in many ways, but I would always prefer to do it without using any third party softwares, because you never know the authenticity of these tools. So the method we would be talking about here is will be done with the help of a script, which is error-free and is very efficient. All you’ll need is a password to unlock the folder, in which all your documents will be contained. And before entering the password, the user cannot even see the folder, so it’s very safe. So let’s get started. Please Note: “Virtuaniz” or the author is not responsible for any loss of documents or files because of any error on the users’ end.

Step 1: Create a folder which will contain all your documents and files which you wish to protect.

How-to-password-protect-files-on-Windows-7-and-8 (4)

Step 2: Open an empty notepad file (press Windows key + R and then type ‘notepad’ and hit enter). Paste the following code in the notepad pad file and save the file as “locker.bat” in the same folder which contains all your files.

How-to-password-protect-files-on-Windows-7-and-8 (5)

cls
@ECHO OFF
title Folder Private
if EXIST “HTG Locker” 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 “Virtuaniz Locker”
attrib +h +s “Vituaniz Locker”
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 “Virtuaniz Locker”
ren “Virtuaniz Locker” Private
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md Private
echo Private created successfully
goto End
:End

Replace ‘PASSWORD_GOES_HERE’ with a password of your choice.

Step 3: The “locker.bat” file will get created. Now click on that, which will create a folder called ‘Private’ will be created. Now you can shift all your files to the private folder. Make sure there are no traces of the files outside.

How-to-password-protect-files-on-Windows-7-and-8 (1)

Step 4: Click on “locker.bat” file again, now it will ask whether you want to lock the folder or not. To lock the folder enter “y” and hit enter.

How-to-password-protect-files-on-Windows-7-and-8 (2)

Step 5: You’re done! But make sure that you have unchecked “show hidden files/folders” option. To get your files, open “locker.bat” and enter the password you have chosen.

How-to-password-protect-files-on-Windows-7-and-8 (3)

Karan Uppal

Karan Uppal is the Editor-in-Chief for Virtuaniz. He is currently a bachelor student of Computer Science at Bangalore and is working with a few start-ups. Karan is a keen learner and loves to travel. He loves reviewing gadgets and claims them to hold an important part in his life. Follow him at @freezethinker to get his updates.

Loading Facebook Comments ...
Loading Disqus Comments ...