A lightweight, portable Batch script to lock (hide) and unlock folders on Windows without installing any third-party software.
⚠️ Important Disclaimer: This tool uses a system trick (renaming to a CLSID) to hide the folder. It provides basic privacy against casual snooping but does not encrypt your files. A tech-savvy user can still access the files if they know where to look. Do not use this for highly sensitive data like banking details.
Warning
Educational Use Only
- No Installation Required: Works directly on any Windows PC.
- Password Protection: Simple text-based password system.
- Stealth Mode: Completely hides the folder from standard Windows Explorer views.
- Fast & Lightweight: Zero background processes or memory usage.
- Clone this repository or Download the
Locker.batfile.git clone https://github.com/hackerstoreofficial/Folder-Lock-Unlock-in-Windows.git
- Place the
Locker.batfile in the directory where you want your locked folder to exist.
- Right-click
Locker.batand select Edit (or Open with Notepad). - Find the line that says:
if NOT %pass%==YOUR_PASSWORD_HERE goto FAIL
- Replace
YOUR_PASSWORD_HEREwith your desired password. - Save the file (
Ctrl + S).
- Create Locker: Double-click
Locker.bat. A new folder namedLockerwill appear. - Add Files: Move your private files into the
Lockerfolder. - Lock: Double-click
Locker.batagain. TypeYand press Enter. The folder will vanish. - Unlock: Double-click
Locker.bat. Enter your password to reveal the folder.
If you prefer to create the file manually, copy the code below into a new text file and save it as Locker.bat.
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 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 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%==YOUR_PASSWORD_HERE 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
:EndThis script uses a built-in Windows feature called CLSID (Class Identifier).
- Renaming: When you lock the folder, the script renames
LockertoControl Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}. - System Trick: The UUID
{21EC2020-3AEA-1069-A2DD-08002B30309D}corresponds to the Windows Control Panel. - Result: Windows Explorer sees this UUID and treats the folder as a shortcut to the Control Panel, effectively hiding the original contents and changing the icon.
- Attributes: The
attrib +h +scommand sets the folder as Hidden and System, making it invisible to standard users.
Forgot Password? Since this is a script, you can right-click the .bat file and choose "Edit" to see or change the password.
Folder Not Hiding? Ensure "Show hidden files" is disabled in your Windows Explorer View settings.
This project is licensed under the MIT License. Free to use and modify.
Developed with ❤️ by hackerstoreofficial