The Wicked Coder

PHP, fun and all

Locking Files and Folders with a simple Batch Script

Many of my students were asking about folder locking tools. here is a simple but effective solution.

Locking Files and Folders with a simple Batch Script 

+ Locked/Unlock folder w/ Custom Password(s).
+ Hide anything inside!
+ Works on Windows!
+ Delete Feature1. Open Notepad.

2. Copy code below and paste it in Notepad.

@echo OFF
title Folder Locker
if EXIST “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” goto UNLOCK
echo Are you sure u 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.
ren Locker “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”
attrib +h +s “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”
echo Folder locked
goto End
echo Enter password to Unlock folder
set/p “pass=>”
if NOT %pass%==Wickedcoder 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
echo Invalid password
goto end
md Locker
echo Locker created successfully
goto End
Be sure to change the password in Notepad!

3. Save it as: Locker.bat (make sure to select Save as Type: All Files).

4. To edit code, Right click icon on desktop (or saved location). Select “Edit”.

How to Lock & Hide the Folder.
Click the icon it creates on you desktop.
(This create a visible folder on your desktop, which you can place items into).
After you have finished editing contents of your folder, Click the icon to lock and hide the folder.

How to Unlock & Show folder.
Click the icon it creates on you desktop.
Enter Password.
Updated: April 23, 2014 — 3:21 am
The Wicked Coder © 2014