You may have some data or files you do not want to share with others. You may have thought of locking folders in your PC, but couldn’t find a way to do so. In this post, I will tell you the easiest way to lock your folders.

What method we are going to use?

There are dozens of software on google for folder lock, you can always download them. some of them are free and some are premium.

We are going to use batch files to lock your folders.

According to Wikipedia:

“A batch file is a script file in DOS, OS/2 and Microsoft Windows. It consists of a series of commands to be executed by the command-line interpreter, stored in a plain text file.”

But there is a problem with this method. If someone has programming knowledge or batch files coding knowledge then he/she can easily access your locked data.

Here is the good news: Still most of the people are unfamiliar with command prompt and batch files. So, it is still useful. To be honest, if you want to secure your very sensitive data then you must go for a folder lock software.

Read more: What is a Computer Virus? Make it in 20 sec only

Code to Lock folder in PC

  • Open notepad. You can do so by pressing windows key and then type notepad and hit enter.
  • Now copy and paste the following code in your Notepad.

@ECHO OFF
if EXIST “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” goto UNLOCK
if NOT EXIST Private goto MDPrivate
:CONFIRM
echo Are you sure to lock this 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 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 Your Secure Folder
set/p “pass=>”
if NOT %pass%== MasterHere FAIL
attrib -h -s “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”
ren “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” Private
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDPrivate
md Private
echo Private created successfully
goto End
:End


  • Replace MasterHere with any of your desired password.
  • Save this file as “locker.bat”. And choose file type as “All files”.
  • You can even use any name but do not forget to put “.bat” in the last.
  • Now close notepad and open the Program where you saved.
  • Now enter the password and hit enter.
  • As soon as you hit the enter key, a new folder named private with be created.
  • Save the files you want to secure in this folder.
  • When done, double click on the locker program.
  • It will ask “Are you sure to lock this folder?”
  • Type “y” and hit enter.
  • Suddenly the folder will disappear.
  • Double click the program and enter the password to make your folder appear.

Read More: How to Hide/Unhide folders in Window 7, 8, 10

How it can be cracked?

Anyone with a little bit knowledge of batch files can easily figure out your password.

You can right-click on the program, then click on the edit button and then you can easily see and change the password.

You may read our another post “How to lock your pc folder |part2|“. It is more difficult to crack because the password is not saved in the code but somewhere else.

Give us a moment

It will hardly take 1 minute to complete our survey. It only consists of 6 short questions. Please complete it so that we can make some great experiences. Click here to proceed.

Please help us to Grow. We try to provide best and reliable data for our users. We cannot do it without your help. You can help us even by telling some suggestions, correction and adding something useful to our Post.

 


0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *