web analytics
Home / Microsoft Windows / Lock Folder with Simple Coding Lock Program

Lock Folder with Simple Coding Lock Program

One of the most asked questions by our reader on windows is “How can I lock folders without using any software?’. Certainly, you want to protect your folder from getting accessed or noticeable to others. Anyway, if you want to protect your files and folders from getting visible to others, you can hide it by specifying the attribute as system files, which will not show the files and folders even if “show hidden files and folder” are enabled check here. However, the below locker trick works similar to the article we wrote earlier as explained above.

This code was actually shared on Forum, and credit goes to the original creator of this code. Basically, when you run the program, it will create a new folder. Files which you want to keep it hidden and safe, you can copy those files into this folder, and you will run the program again. Once you run the program, the newly created folder will vanish and will not be visible even if “show hidden files and folder” is enabled.

Follow below steps to Lock Folder with Locker Program

1. Open Notepad, Start –> Run –> Type Notepad and Press Enter.

2. Copy the below Code and Paste the following code in notepad and save the file Named Mylocker.bat or name it whatever you want but make sure it end with an extension as “.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 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.
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 By Techie Inspire
echo Enter password to Unlock folder...
set/p "pass=>"
if NOT %pass%==typepasswordhere 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 (ANY MORE WRONG PASSWORD YOUR SYSTEM WILL BE LOCKED)
goto end
:MDLOCKER
md Locker
echo Locker created successfully
goto End
:End

3. Now, Just Execute (double click) the Mylocker.bat and New folder will be created named as “Locker”. Store your secret files and folder inside this folder.

4. Double-click again on Mylocker.bat file to Lock the folder. You will see “Locker” folder has disappeared.

5. To Unlock, Double-click the Locker.bat and Enter Password. The Folder Locker is back again.

How to Set Password?

In the Code, The password is set to “typepasswordhere”, Find the password typepasswordhere and change with your password.

This program looks cool but there are some drawbacks too. If you have changed the settings of “Hide Protected Operating System Files” to disable(unchecked) in Folder Option. You could see the Locker folder has turned into some control panel icon. If you rename that control panel, the folder will be back. One more drawback of this program is that anyone can change or see the password in the code of “locker.bat”. However, if you are storing some important files, then don’t use this.

Credit of this Coding Program Goes to the Original Writer…

About Kroshan

Roshan Karkera a.k.a. k.roshan. Blogger by passion and software engineer by profession. He believes in sharing knowledge, which made him to start his own blog. He is very much keen & passionate about new technology & Science. If you'd like to connect with him, follow at Google plus or Twitter.
  • Anonymous

    hi
    dj roshan
    i loved ur site and its cool and great
    After coming to your site. i have learnt many things thanks.
    and also all ur post is very usefull
    thank you for that

  • Soleh

    How do you do the coding?..Is it using C#?

  • Dj roshan

    Coding which is used here is basically windows command i.e.,Command prompt command.This code works with the help of windows command prompt…

  • Raaki

    This is excellent man.I m using this now,Great way of protecting files.thanks