[How-To] Lock a Folder in Windows System, Without any Software

Wednesday, June 2, 2010

So you have a content that you need to hide from your friends or family, The best way to do will be Hide the folder from the user.  And if you need a Folder Lock Software, you would do that probably by googling it.  How about making it a bit too geeky.  Sounds fun right! Ahem. In this tutor I 'll guide you to do what I had exactly mentioned in the Title.

  • Copy n Paste the following code to Notepad, 



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 Enter password to Unlock folder
set/p "pass=>"
if NOT %pass%==PASSWORD 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
goto end
:MDLOCKER
md Locker
echo Locker created successfully
goto End
:End

  • Replace your own Password, instead of PASSWORD in the above Code.
  • Save the file with "*.bat" extension, The Filename can be anything that you prefer.
  • When you open the file you had created, a new folder named Locker would be created.  Just move the Folders & Files, that you need to protect.  Again click the created file and press Y to lock the folder.
  • To reopen the file again, Double-Click on the *.bat file and enter the password.

blog comments powered by Disqus