Tutorial: How Password Protect Folders in Windows without using any Software

A Simple Tutorial on How to Password Protect Folders in Windows Without Using Any Software

In our daily computer usage, we usually have files we want to become private and one way of doing this is by enforcing personal password on that specific file or folder to limit third party access. Sadly, most versions of Windows doesn’t have this useful feature built in within the operating system. Although there is a similar security software in Windows called BitLocker, (which allows users to encrypt data in a specific hard drive and enforce password to open it)  this data protection feature is only available to Windows 7 Enterprise, Windows 7 Ultimate, and Windows Server 2008 R2 users.

Here, I will show you a simple trick on how to password protect a specific folder in Windows (applicable to XP, Vista, and 7) without using any third party software.


Step 1: Open Notepad. Go to Start > Program Files > Accessories > Notepad.

Step 2: Paste the following code in Notepad.

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

Step 3: In the code above, replace the PASSWORD_GOES_HERE with your desired password. This will used to open the folder. Example:

if NOT %pass%== hahaha123 goto FAIL

Step 4: Save the file on any location you want (e.g Desktop). Click File > Save As. On the File Name box, type “locket.bat” (including the quotation marks). Note: you can change the name “locker” to any name you want as long as the .bat extension remains.

Step 5: Double click the “locker.bat” file you’ve just created. You will notice that it will create a new folder named Private. This is going to be folder where you can place your private files.

Step 6: If you want to lock and hide the Private folder, double click again the “locker.bat” file. It will ask you if you want to lock the folder. type Y if Yes and N if No.

Step 7: To open the folder, double click again the “locker.bat” file and type in the password you’ve set in Step #3.

You’re DONE! It’s important to take note though that the above steps can hide and password protect your folder but it is not totally 100% secure. It can be effective against an average computer user but an advanced user can easily find a way through to open the folder if he/she wants to.
If you find this article helpful, SHARE it to your friends by clicking the buttons below.


You may also like to read: