To achieve actual password protection for your files and folders, you can use compressing software from command line to make a password protected archive. One such third party tool is 7-zip (its open source and very popular).

With this method you can use the inbuilt Command line interface (cmd) to Securely Lock and Unlock files/folders.

First you need to download the 7-Zip command line version (here), named 7za.exe. This is the exe you will use to run commands on archives.
For convenience and so you don't need to change environment paths, put the 7za.exe file in your user directory.

Example:

7za a archive.7z -psecret -mhe subdir\
adds all files and subfolders from folder subdir to archive archive.7z using password "secret". Also it encrypts archive headers (-mhe switch), so filenames will be encrypted.

Note:Remember to Delete the original Folder after archieving it.
The drawback is that every time you need access to that folder you have to extract it first. This can be automated by writing a bat file for the purpose of locking and unlocking.

thanks for the answer. But, the thing is, if we use software it's the simplest way to lock the folder. But, what i need is password protected should be done using only command line and without using any softwares. And, thanks for the help.
–
Venkat ManoharSep 6 '12 at 7:39

The method I describe here will work from the Command line itself, just command line version of 7zip needs to be there.
–
LambSep 6 '12 at 7:52

that's not possible....there is no way to password protect a folder without a third-party software. The best you can do is encrypt it..
–
tumchaadityaSep 6 '12 at 9:04

@tumchaaditya What do you mean by that's not possible, Does it not works ? Did you read the answer? it mentions that it relies on 3rd party tool. But it still satisfy the requirement -"How can we lock folder using the Command Prompt". It is not mentioned in the question that 3rd party tool should not be involved, actually OP wants to do it from cmd. correct me if I'm wrong.
–
LambSep 6 '12 at 10:20

1. i specfically menetioned "without using third party software" and 2. if you read carefully, the person asking question specifically mentions avoiding third party tools in comment on this answer(and i was targeting this requirement when I said "that's not possible")....pardon...should have included @ in comment...
–
tumchaadityaSep 6 '12 at 11:07

This is a very simple trick that can hide the folder. But not password protecting it. Anyone who has basic knowledge in batch programming can write batch file to unhide it. But you can make it into exe file and then nobody can change the password as in batch file. But they can write another batch file to do it. This kind of folder is not visible even when chosen the show hidden file option. Compile it into exe file.

The normal way on windows to protect files (in a folder) would be EFS. However it is tied to the login password, so you don't really see its effect (and it does not help if you share the password or the account).

Real password protection for a selected directory tree can be achieved with disk encryption tools (like truecrypt). When you want to unlock the directory, you need to mount the truecrypt file, and for this you need the password. BitLocker is the build in option from Windows, but I think you need the Ultimate edition to use it as flexible as TrueCrypt in this scenario.

That's not possible....there is no way to password protect a folder without a third-party software.
The best you can do is encrypt it using windows default features. But technically it wont be password protected...