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..

[Reply]
Harwinder said on 1/03/2012 11:10 PM:

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

[Reply]
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

[Reply]
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

[Reply]
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 .

[Reply]
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!!

[Reply]
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

or

calcs file_dir /E /P everyone:y

[Reply]
Anonymous said on 3/24/2012 12:52 AM:

f means full permissions.
n means no permissions

[Reply]
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.

[Reply]
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

CACLS not ICACIS

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

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

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

Well the post was really very helpfull... Thanks

[Reply]
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????

[Reply]
Anonymous said on 10/16/2012 7:25 AM:

what to do to regain access to logical drive d:

[Reply]
Harwinder said on 10/16/2012 12:56 PM:

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

[Reply]
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.

[Reply]
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!

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

how to get contact form?

[Reply]
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!

[Reply]
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....

[Reply]
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 ..??

[Reply]
Harwinder said on 12/09/2012 6:24 PM:

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

[Reply]
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

[Reply]
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

[Reply]
Anonymous said on 6/09/2014 9:09 AM:

i try it again and again please help me

[Reply]
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?

Thanks

[Reply]

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

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