Lock Your Drives and Folders Using Registry Tweaks

There are plenty of software which locks drives and folder to protect your confidential data. Why waste money on such tools when you can do it with a simple registry tweak? Here’s how:

Caution: Before you attempt these tweaks, please make sure that you have a backup of your registry, just incase something goes wrong in the middle.

Locking Folders:

  • Consider you want to lock a folder named XXXX in your E:\, whose path is E:\XXXX.
  • Now open the Notepad and type the following

[code]ren xxxx xxxx.{21EC2020-3AEA-1069-A2DD-08002B30309D}[/code]

  • Where xxxx is your folder name. Save the text file as loc.bat in the same drive.
  • Open another new notepad text file and type the following

[code]ren xxxx.{21EC2020-3AEA-1069-A2DD-08002B30309D} xxxx[/code]

  • Save the text file as key.bat in the same drive.

Steps to lock the folder:

  • To lock the xxxx folder, simply click the loc.bat and it will transform into control panel icon which is inaccessible.
  • To unlock the folder click the key.bat file. Thus the folder will be unlocked and the contents are accessible.

Locking Drives:

We don’t usually prefer to lock our drives, but sometimes it becomes nesscary. Say for instance you might have stored your office documents in D:\ and you don’t want your kids to access it, in such case this technique can be useful for you. Please don’t try this tweak with your root drive (usually C:\ is the root drive) since root drives are not intended to be locked because they are mandatory for the system and application programs.

  • Start & Run and type Regedit to open Registry editor
  • Browse HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Policies\Explorer
  • Create a new DWORD value NoViewOnDrive and set its value as

2^ (Alpha Number of Drive Letter-1) where Alpha number are simple counting of alphabets from A to Z as 1 – 26

For example: to lock C:\, Alpha number of C is 3 so 2^ (3-1) = 4 (decimal value)

  • To lock more drives, calculate the value of each drive and then set sum of those numbers as value
  • To unlock your drive just delete the key from the registry.

Hat Tip by anilmail17 and wizrulz.

This post was published by on February 4, 2007

About the Author: Thilak Rao works as a Social Media Expert. He is one of the first professional bloggers from India, and he loves to write, travel and click photos. Follow him on Twitter @thilak

  • http://www.reviewsaurus.com ReviewSaurus

    Nice post sankar. Like this we can change it to control panel (the example you gave)….to my computer and other system folders like this….its simply helpful :)

  • http://www.ghacks.net/2007/02/05/lock-folders-in-windows/ gHacks tech news

    Lock Folders in Windows

    Windows has no obvious method to lock folders, even administrators have no obvious way of locking folders. Locking folders could be important if you want to hide certain files or folders to prevent someone else from seeing them or altering the contents…

  • http://technospot.net/blogs Ashish Mohta

    I better would not play with registeries.They really scare me

  • http://www.sankaranand.com Sankar Anand

    @Ashish Mohta

    Oh ! “Practice makes perfect”
    back up your register and set for the game…

  • V.Vivek

    oh thats a useful post .
    and like u said going and editing registry is always thrilling.
    and “practice makes perfect”.

  • Asit

    Nice work and it’s really good.

  • http://yahoo Sabarish

    It was really helpful. But i want to know how the file or folder can be made undeletable.

  • http://tech-buzz.net Thilak

    Sabarish: Did you try Recuva. Its Free!

  • somi

    how is the folder protected? is there a password or what? can anyone who got the accesibilety to the .bat files lock/unlock the folder?

  • Aruna

    I tried “Locking Drives:” method. but its not working for me. the drive still remains even i set d value. ( i set value 8 for d:\) but still i can see the drive even i set the value as 8. what i have to do? please help me.

    Hiding folder option is working. it s really useful for me.
    Thanks shankar .
    Also tell me “21EC2020-3AEA-1069-A2DD-08002B30309D”.. how did u calculate this value? please tell me the way to calculate. thanks Friend

    Aruna.S.K.S

  • http://www.onetipaday.com/2007/02/05/protect-your-files-from-prying-eyes-by-locking-folders/ Protect Your Files From Prying Eyes By Locking Folders | OneTipADay.com

    [...] Tech-Buzz Share This | Read Comment (1) | Comments RSS | Top Tip: Get Paid To [...]

  • Alok Rawat

    Shankar it works but problem is that you can see that folder content and also use their content. there are some tricks.

  • Dushyant

    I want some useful regedit pl help me. I’m thanks ful you.

    Dushyant

  • http://none cricketfan

    I did this and it worked.
    But then I renamed the original file to check it.
    I forgot to back up.
    Then I renamed it back and it did not unlock after I
    opened “key”.
    Please help me as I need that folder asap.
    My Email is MrKhurramSaeed@yahoo.com.au

    Thanks in advance

  • http://sankaranand.com/blog/ Sankar Anand

    saeed which file did u rename ? the .bat file or the folder itself ? can you explain your problem in detail ?

    If u renamed your folder name make sure you rename again to the name that was placed before…

  • Nazar Abbas

    Thanks shankar .
    Please tell me “21EC2020-3AEA-1069-A2DD-08002B30309D”.. how did u calculate this value? please tell me the way to calculate. thanks Friend

  • http://monsterblog.uni.cc/2007/05/12/lock-that-pr0n/ Lock that pr0n!

    [...] These softwares are only used when there is no way other way left to lock files. But my friend at TechBuzz has shown that you can easily lock your files and drives by using the following trick. The [...]

  • http://harisn.wordpress.com/2007/05/12/lock-that-pr0n/ Lock that pr0n! « Haris Nadeem

    [...] These softwares are only used when there is no way other way left to lock files. But my friend at TechBuzz has shown that you can easily lock your files and drives by using the following trick. The best [...]

  • http://harisn.wordpress.com/2007/05/12/ssshh-lock-that-pr0n/ Ssshh – Lock that pr0n! « Haris Nadeem

    [...] These softwares are only used when there is no way other way left to lock files. But my friend at TechBuzz has shown that you can easily lock your files and drives by using the following trick. The best [...]

  • http://harisn.wordpress.com/2007/05/23/lock-files-in-windows-xp/ Lock files in Windows XP « Haris Nadeem

    [...] These softwares are only used when there is no way other way left to lock files. But my friend at TechBuzz has shown that you can easily lock your files and drives by using the following trick. The best [...]

  • http://harisn.wordpress.com/2007/05/23/hide-pr0n-in-your-pc/ Hide pr0n in your PC « Haris Nadeem

    [...] These softwares are only used when there is no way other way left to lock files. But my friend at TechBuzz has shown that you can easily lock your files and drives by using the following trick. The best [...]

  • Youbaraj

    That was very cool idea to lock foldrs.. but i want to lock folders also from registry…..
    but you method lets users to delete that folder..
    please send me an idea to lock folders from registry editor.

  • apsingh

    ok i was able to lock the folder but i was not succesful to unlock the folder . so i request you sir/mam to help me out as soon as possible
    Thank you

  • http://www.manadoadventure.com Sophronismos

    go into console “Start – run – and type cmd”

    if your locked folder on D:\ drive then type D:\, just hope that your tab is working. let just say that your folder was “test”, than you change into “test.{21EC2020-3AEA-1069-A2DD-08002B30309D}”. In this case if you open in explorer you will ended up into control panel. So, at the console just type “ren test” followed with tab button. Then you can see your full folder name. Continue with “test” then enter.

    To lock drive i use the group policy editor. “start – run – gpedit.msc”

    User Configuration – Administrative templates – Windows Component – Windows Explorer, on the right panel you’ll see the settings. You can set the Hide or Prevent access. Just double click, choose enable and pick your choice. thats all

  • http://www.tech4dummies.net praveen

    changing the registry is not recommended for end users , if something goes wrong while editing registry , creates more problems, it is better to use some tools folder lock

  • http://www.tech4dummies.net praveen

    It is better to use some freeware tools like folder lock , instead striking against registry for end users. Say if something goes wrong while editing the registry, it will create more problems

  • http://www.bimbo-toys.ru Biilling

    Nice work and it’s really good.

  • http://trilinearjet.wordpress.com/2007/05/21/lock-that-pr0n/ Lock that pr0n! « Trilinearjet’s Weblog

    [...] These softwares are only used when there is no way other way left to lock files. But my friend at TechBuzz has shown that you can easily lock your files and drives by using the following trick. The best [...]

  • http://topsoftnews.com/2007/11/08/lock-your-drives-and-folders-using-registry-tweaks/ Top Soft News » Lock Your Drives and Folders Using Registry Tweaks

    [...] read more | digg story [...]

  • http://www.web2tor.com/2007/05/21/lock-that-pr0n/ » Lock that pr0n! Web2tor: All about sharing…

    [...] These softwares are only used when there is no way other way left to lock files. But my friend at TechBuzz has shown that you can easily lock your files and drives by using the following trick. The best [...]

  • yogendra

    I tried to lock the folder using this tweak on Vista but it did’t work. Any solution for Vista users?

  • cng

    Hello.
    I need lock drive a:+d:
    Lock a: – normal ( value 1)
    Lock d: – not work access is not blocked (value 8+1=9)

    please help

    Sorry my english

  • Nami

    the loc.bat and key.bat file i made is not working here… does it requires any other procedures… i just did what you have post and nothing happens. it didnt lock my folder…

  • Jonathan

    If you have the tools… A very useful tip.

  • http://resistme.com/?p=182 Lock that pr0n! | Resist me Blog!

    [...] These softwares are only used when there is no way other way left to lock files. But my friend at TechBuzz has shown that you can easily lock your files and drives by using the following trick. The best [...]

  • himanio

    hi
    u can also use .{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1} & it doesnt change the appearance of the folder

  • himanio

    hi
    u can also use .{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1} & it doesn’t change the appearance of the folder.its better not to create batch file but to save the extension somewhere hidden.

  • vijayakumar

    HI, I have a doubt
    I want to hide the harddisk drives from only users not administrator what to do
    reply as early as possible

  • http://www.omnitechsupport.com/forum/ protect your computer

    it is very good post.
    i was searching for lock from registry

  • http://www.whittierpc.com Iman Diaz

    Thank You very much I know there exist many product that do the same thing, but I find this solution much easier!

  • V.Vivek

    oh thats a useful post .
    and like u said going and editing registry is always thrilling.
    and “practice makes perfect”.

  • hongphalla

    hello

  • sagi

    i browse
    HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurre ntVersionPoliciesExplorer

    but i can't see Explorer on my ….why?is there any problem in the registry?

  • sagi

    i browse
    HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurre ntVersionPoliciesExplorer

    but i can't see Explorer on my ….why?is there any problem in the registry?