Introduction: How to Lock Folder Through CMD
This Trick Will Show You That How To Lock Folder Through CMD.
I had Written Some Codes In Notepad and Save As .bat File To make It for a DOS.
The Codes are given in STEP:#3
The provided Codes has Some Parts in which the User's name and password is mentioned, so you can change that in your own way you want. (described in STEP:#3)
I HOPE YOU LIKE IT USERS!
Follow ME To Know Some More Stuff Like this And Miscellanious Tips Nd HAcks...
SURF IT! LEARN IT! SHARE IT!
LOVE CMD! oR NOTEPAD! (Uhhh...the Same thing till used as .bat)
(MS-DOS FOR BEGINNERS): I Would also Like to Mention That Batch Programming is the Easiest/Funniest & Interesting thing To Know About, so just try to read my codes line-by-line and just try to understand the way that codes carried out for their action otherwise Read Books For your Reference or Just Google And Follow Some Of the Best Forums, Blogs Nd all...
Step 1: #1
Step 2: #2
Step 3: #3
SO THE CODES ARE HERE:
cls
@ECHO OFF
title Folder Locker
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST secured goto MDLOCKER
:CONFIRM
echo Are you sure u want to Lock the secured(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 secured "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s +r +i "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo secured locked
goto End
:UNLOCK
echo put in the key to Unlock the lock
set/p "pass=>password"
if NOT %pass%==123456 goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" secured
echo secured Unlocked
goto End
:FAIL
echo Invalid keyword
goto UNLOCK
:MDLOCKER
md Secured
echo lock unlocked
goto End
:End
NOTE: In 23rd Line You can see the default password i.e., 123456 , so just change this to the password you want.
- So Just write The Codes In a same Way it is written And Save as "all file" type with file name lock.bat or anything.bat
OH! Wait! Some Of You Find it Difficult To write! i Guess, Okay! Download iT From here:
http://www16.zippyshare.com/v/57113048/file.html
Step 4: #4
Step 5: #5 (See Description Too)
Bug: Some Of The Users Told Me That during This Step #5 when we lock the folder, the folder is still seen...
Bug Fixed: So Just Refresh (Press Ctrl+F5) it once in desktop or in the location where you are trying to lock that file...
Step 6: #6

Participated in the
Tech Contest

Participated in the
First Time Author Challenge
35 Comments
Question 2 years ago
yes working properly. but what if unfortunately i remove that bat file how can i get back that ?
2 years ago
Hi! i did this but now my file is courrupt and unreadable how to recover the data?
Question 5 years ago
Here the attrib is not recognized coming
Question 5 years ago on Step 5
Not coming the locked folder
6 years ago
if you could move it to another folder and when you unlock the folder it is in the same location as it was before the script
Reply 6 years ago
like system32/drivers/etc
7 years ago on Introduction
What if some tries to edit .bat file by right clicking -> edit.
now someone else can see our password and can even change it
Reply 6 years ago
you can convert it to exe-file
Reply 7 years ago
You put in a whole lot of useless code that explodes their brain when they read it.
7 years ago
Hi i was wondering how you could change the name of the folder.
Reply 6 years ago
ren "folder curret name" new name
6 years ago
its not safe just hidden the folder
Reply 6 years ago
how to know if its hidden or not? how do you check?
6 years ago
thanks i made it!
6 years ago
You're great man! Thanks a Lot!
6 years ago
I can't make it :(
7 years ago
this is unsafe all I have to do is open cmd in the same folder as the batch file (shift right click) and type attrib -s -h to view the files.
7 years ago
Hey i made a really good folder locker with VBScript, if anyone wants it email me at raxhonPlex@yandex.com
7 years ago
how do I it to lock a folder
7 years ago
don't know what i would do without you