ghacks Technology 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. You never know what your children could do until they do, so better lock the important folders.

Locking folders can be easily done with just two batch files that protects the contents. This is no fool proof method of course and everyone who is computer savy is able to counter this. You need to create two textfiles, add one line of code to each and save them as .bat files to make them executable.

Add the following line to the first text file ren xxxx xxxx.{21EC2020-3AEA-1069-A2DD-08002B30309D} .Replace xxxx with the folder or drive name and save the file with the extension .bat, name it protect.bat for instance.

Now add the following line to the second text file and rename it unlock.bat. ren xxxx.{21EC2020-3AEA-1069-A2DD-08002B30309D} xxxx. Replace xxxx again with the orginal name of the folder.

To lock a folder just click on protect.bat, to unlock it again click unlock.bat

source: tech-buzz




Tags: , , ,
Categories: Operating Systems, Windows



Related posts:

Automatically Lock your computer
Use USB Flash Drives To Lock Windows
Create Send To Entry for non-default printers
Colorize your Folders in Windows
Windows Tip: Don’t replace any files while copying
Lock your Devices with Device Lock
Clean Windows from all empty folders
Check the size of your folders

9 Responses to “Lock Folders in Windows”

  1. Tobey says:

    Or you can just restrict access to those folders. But that’s less effective of course.

  2. Luke says:

    How about:

    cacls FOLDER /R USER

    This will prevent USER from ever accessing FOLDER. Alternatively you can do:

    cacls FOLDER /G Administrator:F

    This will overwrite the default settings and make Administrator the only user allowed to touch it.

  3. Martin says:

    This is pretty nice Luke, where did you find the information ?

  4. Luke says:

    I think I found this when I was trying to set up private folders on a WinXP Home box. The home edition does not have the permissions tab in the file properties dialog, so the only way you can set file permissions for individual users is via cacls.

    Not sure where I found it exactly, but one of the best websites that explain all the windows command line commands is http://www.ss64.com/nt/

    They cover all the build in stuff, as well as a lot of the stuff that comes in different Microsoft administrator kits and etc.

  5. Luke says:

    Shyborg, you would have to restore privledges for yourself – for example:

    cacls FOLDER /E /G Shyborg:F

    The /E switch means that you are editing the privs – not replacing them. If you are a part of a domain you may need to do:

    cacls FOLDER /E /G DOMAIN\Shyborg:F

    Best way to do this is to look at another folder’s permissions and then replicate them on tour secret folder:

    cacls OTHER_FOLDER

    See which users have what permisions and just restore them using separate cacls commands. Don’t forget to use /E every time.

    Good documentation of cacls is here: http://www.ss64.com/nt/cacls.html

  6. Ranjith says:

    Nice stuff, thanx

Leave a Reply   Follow Ghacks   Subscribe To Comment Rss

© 2005-2009 Ghacks.net. All Rights Reserved. Privacy Policy - About Us