Folder lock using command prompt

To lock a folder in windows XP without any software. Follow the steps below.

1. Make a Folder in any drive.

2. Now open Command Prompt. Set your Drive and Directory where you make your folder.

3. Type "attrib +s +h C:\ajay" without quotes and press enter.
(Here I make a folder in C Drive and name it a).

4. This command will make your folder invisible.

5. To make it visible again type "attrib -s -h C:\ajay".

You can lock any other folder also by changing the location C:\ajay to address of your folder.



Author: Prashant Swami18 Nov 2009 Member Level: Silver   Points : 0

Nice tip.
will try.


Author: Vinod12 Aug 2010 Member Level: Gold   Points : 1

hi Ajay Kumar Tak

is this locking the folder or hiding?
where is the password?

and i think if you have password to open a folder than and only than it called lock folder.
am i right?

All the best

Author: Sharad Sharma12 Aug 2010 Member Level: Gold   Points : 1

Thanks for a nice tip

Can we lock the folder in such a way, that would need a password when we double click it.


Author: Anil Mehta30 Aug 2010 Member Level: Silver   Points : 0

It's a very nice tip.
thanks for this.

anil jain

Author: Ajay Kumar02 Feb 2011 Member Level: Silver   Points : 0

Guest Author: Usama Zia30 Apr 2012


well i remember some kind of code when i was a used to lock the folder which cannot be deleted and cann0t be viewed unless we enter the command prompt and den go to the location and enter those keywords..i dont really remember what it was as i jsut remember to type 3 numeric values while pressing the ctrl button or alt i dont remember far as i remember it was really awesome...cant even format the drive unless the same numeric values are pressed in the command prompt to unlock that was kinda password protection..if u get it n u know something about it then do tell us...thanks..

Guest Author: karan rai01 May 2012

This is very nice tip. If any one known that folder is password protected he trying to break up so it is good to disappear..

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: