How to Password-Protect Folders on Windows Without Any Software
🔐 Your Privacy, Your Rules — No Apps Required
Whether you’re trying to keep sensitive files safe or just hide that surprise gift folder, you don’t need to install any sketchy locking software.
Windows has a built-in trick using a simple batch file that can lock folders with a password.
It’s not military-grade encryption, but it’s perfect for everyday privacy. Let me walk you through it.
🛠 What You’ll Need
- A Windows 10 or 11 PC
- Notepad (yep, that’s it)
- About 2 minutes of your time
🧾 Step-by-Step: Create a Password-Protected Folder
✅ 1. Open Notepad
Right-click on your desktop → New → Text Document
Open it and paste the following code:
cls
@ECHO OFF
title Folder Locker
if EXIST "Private" goto UNLOCK
if NOT EXIST "Private" goto MDLOCKER
:CONFIRM
echo Are you sure you want to lock the folder? (Y/N)
set /p "choice="
if /I "%choice%"=="Y" goto LOCK
if /I "%choice%"=="N" goto END
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%==yourpassword goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" "Private"
echo Folder unlocked
goto End
:FAIL
echo Incorrect password
goto end
:MDLOCKER
md Private
echo Private folder created
goto End
:End
🛡️ 2. Replace yourpassword
with your actual password
Pick something secure but memorable.
💾 3. Save the File as a Batch Script
- Click File → Save As
- Set file name:
locker.bat
- Choose All Files under file type
- Save it in the folder where you want the protected folder to appear
🧪 How It Works
- Run
locker.bat
→ it creates a folder called Private - Drop your files inside it
- Run
locker.bat
again → pressY
to lock it - The folder disappears (hidden + disguised as Control Panel)
- Run
locker.bat
again → enter password to unlock it
🧠 Jake Says: You’ll only see the folder again after you enter the correct password.
⚠️ What to Know
- This isn’t encryption — it just hides the folder in a clever way.
- Anyone who opens the
.bat
file in Notepad can see the password unless you obfuscate it. - Use it for casual privacy—not for tax records, sensitive client files, etc.
💡 Bonus: Add a Layer of Obscurity
- Rename
locker.bat
to something boring likesysconfig.bat
- Store it in a subfolder
- Disable file extensions visibility so others can’t tell it’s a batch file
(View → Hide extensions for known file types)
📌 TL;DR – Lock a Folder in 60 Seconds
Step | Action |
---|---|
1 | Paste batch script into Notepad |
2 | Replace password |
3 | Save as locker.bat |
4 | Run to create + lock folder |
5 | Run again to unlock with password |
🧢 Jake’s Final Word
Sometimes you don’t need fancy software—just a clever little trick.
This one’s been around for years, and it still works like a charm.
Want a stronger method with real encryption? I’ll cover that in another post.