26How To Lock Folder With Command Prompt?

Posted by Harwinder Kumar at 1/07/2011 Posted in: ,

Lock Folder
Want to lock a folder without using any software / password in Windows, follow these simple steps:
  • Go to start> run> cmd
  • In command prompt, Type cacls "path_of_folder" /E /P everyone:n
  • To regain access type: cacls "path_of_folder" /E /P everyone:f
Note: Do not lock C:\ drive using this trick otherwise Windows will not boot next time. I have already explained one more method of folder locking using Batch. You can check it from here.
Hope You Liked It. Receive Latest Posts Directly To Your Email
Get Free Updates:
Click On The Confirmation Link Sent To Your Inbox Or Spam

26 comments so far:

Anonymous said on 1/03/2012 11:03 PM:

dude i cannot gain access to my folder now please help..

Harwinder said on 1/03/2012 11:10 PM:

To regain access type: cacls "path_of_folder" /E /P everyone:f

Anonymous said on 1/04/2012 9:25 PM:

it shows
The filename, directory name, or volume label syntax is incorrect.
wat shud i do now

Harwinder said on 1/04/2012 11:20 PM:

it means you have entered the wrong path of the file/folder

your path must be like it: c:\hacked

Anonymous said on 1/10/2012 1:06 PM:

i have entered the correct path but still its showing the same message..
trick doesnt succesfully works .

Harwinder said on 1/10/2012 2:42 PM:

it should work perfectly buddy!! check your command again or mention here what you're entering!!

Anonymous said on 3/14/2012 8:19 PM:

... mr. author you mean..
calcs file_dir /E /P everyone:no

to activate..

to deactivate..
calcs file_dir /E /P everyone:f ? meaning false?
no = false = 0

maybe try this one..

calcs file_dir /E /P everyone:1


calcs file_dir /E /P everyone:y

Anonymous said on 3/24/2012 12:52 AM:

f means full permissions.
n means no permissions

bharadwaj said on 6/03/2012 11:18 PM:

Icalcs "pathname" /e/p everyone:n
it is saying not successfully proceed.
can help u the correct command.

Harwinder said on 6/03/2012 11:59 PM:

@bharadwaj: put space between /e and /p like it: cacls "path_of_folder" /E /P everyone:n


Riyan Tariq Still Alive.. said on 8/08/2012 10:43 AM:

Well the post was really helpfull.... Thanks a lot

Riyan Tariq Still Alive.. said on 8/08/2012 10:44 AM:

Well the post was really very helpfull... Thanks

Anonymous said on 10/14/2012 8:40 PM:

i am also not gaining my folder again
through command
cacls foldername /E /P everyone:f(this also doesnot work)
cacls foldername /e/p everyone:f(this also doesnot work)
cacls foldername /e /p everyone:F(this also doesnot work)
what can i do now????

Anonymous said on 10/16/2012 7:25 AM:

what to do to regain access to logical drive d:

Harwinder said on 10/16/2012 12:56 PM:

@Anonymous: its not foldername, its folderpath after cacls!!

Viveksing Vijay Chavan said on 10/16/2012 6:17 PM:

I am also not gaining access of my folder.
Initially I was able to gain access.
But from yesterday I lost access of my locked folder.
I tried cacls "E:\VIVEKSING" /E /P everyone:f many times.
But its not working.
Please tell me as soon as possible. There are urgent files in that folder.

Harwinder said on 10/16/2012 11:19 PM:

@Viveksing Vijay Chavan: those who are facing problem while regaining access to their folders, contact me via contact form, I will solve their issues via teamviewer or logmein!

Thanks for reading!

Viveksing Vijay Chavan said on 10/17/2012 5:44 PM:

how to get contact form?

Harwinder said on 10/17/2012 5:56 PM:

@Viveksing Vijay Chavan: on the top of the site under menu bar, you will find it!

Aashish Sehraya said on 12/09/2012 6:18 PM:

i wana lock aman foldr in g drive ... then what i should give the command in cmd ... explain plzz....

Aashish Sehraya said on 12/09/2012 6:22 PM:

i wana lock aman games folder in g drive thn plz explain ki kya command du cmd me ..??

Harwinder said on 12/09/2012 6:24 PM:

@Aashish Sehraya: cacls "D:\aman" /E /P everyone:n

Kartik Umalkar said on 3/09/2013 9:06 PM:

i want to lock a folder picography on my desktop wath should i type cmd

Harwinder said on 3/09/2013 9:53 PM:

@Kartik Umalkar: use "cd desktop" in cmd firstly to go to desktop location, then follow the above steps! Thanks

Anonymous said on 6/09/2014 9:09 AM:

i try it again and again please help me

Harwinder Kumar said on 6/09/2014 11:58 AM:

@Anonymous: Hi, can you please specify folder path where are you making changes so I can provide exact command?



We love to hear from you! Leave us a comment:

© 2014 Learn The Basics Of Ethical Hacking About | Site Map | Privacy Policy | Contact