Skip to main content

How to Lock a Folder Using Notepad (and Why to Encrypt Instead)

Locking a folder on Windows

Short answer: a popular Notepad batch script can hide and "lock" a folder behind a password for casual privacy. It is a fun trick that stops a nosy sibling or coworker, but it is NOT real security, the files are recoverable. For anything genuinely private, use encryption. Here is the trick and, more importantly, the safe alternative.

The Notepad folder-lock script

  1. Open Notepad and paste this script (change YOURPASSWORD to your own):
cls
@ECHO OFF
title Folder Locker
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Locker goto MDLOCKER
:CONFIRM
echo Lock the folder? (Y/N)
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==N goto END
: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
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}" Locker
echo Folder Unlocked
goto End
:FAIL
echo Wrong password
goto end
:MDLOCKER
md Locker
echo Locker created
goto End
:End
  1. Save it as Locker.bat (choose All files).
  2. Run it once; a folder named Locker appears. Put your files in it.
  3. Run the .bat again and choose Y to lock/hide it; run again and enter the password to unlock.

Why this is NOT secure

Be clear-eyed about what this does: it hides the folder and gates it behind a password check in plain text. Anyone can:

  • Open the .bat in Notepad and read the password directly.
  • Turn on "show hidden and system files" to reveal the folder.
  • Access the files, which are not encrypted at all.

It only stops someone who does not know the trick. Treat it as a curtain, not a lock.

The real way: encrypt

MethodProtection
Notepad lockCasual hiding only
VeraCrypt containerStrong encryption, free
BitLocker (Windows Pro)Full-drive encryption

The non-obvious tip: match the tool to the stakes

For hiding a surprise gift list from a family member, the Notepad trick is fine and fun. For financial documents, IDs, or anything you would truly not want exposed, only real encryption protects you, put those in a VeraCrypt container or a BitLocker-encrypted drive. Never rely on the Notepad lock for genuinely sensitive data; its password is literally sitting in the file.

Frequently asked questions

How do I lock a folder using Notepad?

Paste the folder-locker batch script into Notepad, set your password, save it as Locker.bat, and run it to create, lock and unlock a Locker folder.

Is the Notepad folder lock secure?

No. The password sits in the .bat in plain text, the folder is only hidden, and files are not encrypted. It stops only someone who does not know the trick.

How do I actually protect a private folder?

Use real encryption: a VeraCrypt container (free) or BitLocker on Windows Pro, which keep files unreadable without the password even if found.

When is the Notepad lock good enough?

For casual privacy, like hiding a surprise from family. For financial documents, IDs or truly sensitive data, use encryption instead.

Comments

Popular posts from this blog

How to Completely Uninstall Programs on Windows (Free Tools and Tips)

Short answer: you do not need a cracked Revo Uninstaller Pro, because Revo has a capable free version and there are free open-source alternatives that remove programs completely, leftover files and registry entries included. Here is how to uninstall cleanly and why leftovers matter. Why leftovers are a problem Windows' built-in uninstaller often leaves behind folders, registry keys and startup entries. Over time these accumulate, clutter your system, and occasionally cause conflicts when you reinstall software. A dedicated uninstaller sweeps them up. Free tools that remove programs completely Revo Uninstaller Free , uninstalls the program, then scans for and removes leftover files and registry entries. The free version covers what most people need. Bulk Crap Uninstaller , free, open source, and excellent for removing many programs at once and cleaning leftovers. How to uninstall cleanly with Revo Free Open Revo and select the program. Click Uninstall; let the progra...

How to Recover Deleted Files for Free (Better Than a Cracked Tool)

Short answer: you do not need a cracked 7-Data Recovery serial, because excellent free tools like Recuva and PhotoRec recover deleted files, and the most important factor is not the software at all, it is stopping use of the drive immediately. Here is how to recover files the safe, effective way. The one rule that decides success: stop using the drive When you delete a file, the data is not erased, the space is just marked reusable. The moment you keep saving new files, you risk overwriting the deleted data permanently. So the instant you realize something is gone: stop using that drive . Do not install recovery software onto it either, download it to a different drive or USB stick. The best free recovery tools Recuva , free, friendly, great for recovering deleted documents, photos and files from Windows drives and USB sticks. PhotoRec , free and open source, extremely powerful, especially for photos and media, though its interface is basic. Windows File History / backups , ...

How to Transfer Contacts Between Phones the Easy Way (2026)

Short answer: The easiest way to move contacts is to sync them to a cloud account first. Save contacts to your Google account on Android or iCloud on iPhone, then sign in to that same account on the new phone and they appear automatically. For everything else, export a vCard (.vcf) file and import it. Every time I set up a new phone the very first thing I want back is my contacts. Years ago this meant fiddly SIM copies and desktop software. These days I almost never touch a cable. Here are the modern methods I actually use, ranked from easiest to most manual. Method 1: Google account sync (best for Android) If your contacts are saved to your Google account rather than the phone itself, switching Android phones is basically automatic. On the old phone, open Settings > Accounts > Google and confirm Contacts sync is on. Wait a minute for the sync to finish, or tap the three-dot menu and choose Sync now . On the new phone, sign in with the same Google account during setup....