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.


35 Comments and Trackbacks (Add Your Own)

  1. 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 :)

  2. 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…

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

  4. @Ashish Mohta

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

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

  6. Nice work and it’s really good.

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

  8. Sabarish: Did you try Recuva. Its Free!

  9. 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?

  10. 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

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

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

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

    Dushyant

  14. 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

  15. 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…

  16. 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

  17. [...] 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 [...]

  18. [...] 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 [...]

  19. [...] 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 [...]

  20. [...] 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 [...]

  21. [...] 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 [...]

  22. 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.

  23. 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

  24. 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

  25. 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

  26. 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

  27. Nice work and it’s really good.

  28. [...] 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 [...]

  29. [...] 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 [...]

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

  31. 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

  32. 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…

  33. If you have the tools… A very useful tip.

  34. [...] 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 [...]

Leave a Reply

Grab our RSS feed.

Updates straight to your inbox.