Windows Tips and Tricks Admin Blog

Thursday, January 1, 2009

Lock drives through a registry hack

You can find a lot of softwares which will lock folders, individual files but very few of them can lock drives. Let us lock drives from registry now without taking help from any third party software!

  • Go to Start->Run and type regedit.
  • Navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Curre ntVersion\Policies\Explorer. If the above key doesn't exist, right click on the key named Policies and from New, select Key. Rename the newly created key as Explorer.
  • Once the key has been created, create a new DWORD value in it named NoViewOnDrive.
  • Once this is done, set the data of this value to 2 ^ (ά-1) where ά is equal to the simple numbering of alphabets from A to Z i.e., from 1 - 26. For instance, to lock C:\ά is 3 so 2^ (3-1) = 4 (Decimal value, not HEX!)
  • In order to lock additional drives, you can simply calculate the value 2 ^ (ά-1) for each individual drive and then sum up the numeric values for all drives to be locked and set it as data in NoViewOnDrive registry value.
  • Changes will take effect after computer is restarted (or simply close explorer.exe from task manager and re-run it).
  • To unlock all drives, simply double click the value named NoViewOnDrivefrom and set its data to 0.
Here is a screenshot in which C:\ drive has been locked.



Post a Comment

Subscribe to Post Comments [Atom]

<< Home