PLEASE HELP ME!!!
I was trying to lock a folder with the cacls command, but accidentally typed this: cacls "C:" /e /p everyone:n
but when I type this : cacls "C:" /e /p everyone:f It gives me access denied!!!
How can I fix this????

Dani AI

Generated

Short summary and safest first steps. Applying an explicit “no access” entry for Everyone at the root of C: commonly locks normal accounts (deny ACEs are evaluated before allow ACEs), so even administrators can be blocked. Also note that cacls is deprecated in favor of icacls — use the newer tools below. (learn.microsoft.com)

If you can get an elevated command prompt (or boot to recovery), try to recover your personal profile rather than touching the whole drive. The normal pattern is: take ownership of just your user folder, then grant your account (or Administrators) full control. Example (replace <yourname>):

takeown /F "C:\Users\<yourname>" /R /D Y
icacls "C:\Users\<yourname>" /grant "%USERNAME%:F" /T

Run those from an Administrator CMD; after they complete, reboot and check access. The two commands above are the standard Windows utilities for ownership and ACL repair. (learn.microsoft.com)

If you cannot elevate inside Windows, use Advanced Startup / a recovery USB to open a Command Prompt and run the same steps offline — that often bypasses the “Everyone: deny” lock. If command-line repair fails, boot a Linux live USB or WinPE and copy your data to an external drive (FAT/exFAT doesn’t preserve NTFS ACLs), then rebuild or restore the machine from a good image or restore point. (support.microsoft.com)

Warnings and a reality check. Don’t run blanket resets on C:\ (for example, global recursive resets) unless you have a full backup — resetting ownership/ACLs across the system can break Windows and force a reinstall. ’s idea of using an admin prompt and moving files to a FAT drive is a valid fallback, but the takeown + icacls approach is cleaner when you can run an elevated or offline CMD. If unsure, back up first and seek hands‑on help. (learn.microsoft.com)

You could try opening a command shell as Administrator and typing

cacls foldername /e /g everyone:full

Then you can copy the folder/files to a FAT32 formatted drive. This will copy everything but the ACLs. Delete the original folder then copy it back from the FAT32 drive. If running as Administrator doesn't work you may have to enable the actuial Administrator account and log on as Administrator. You can activate the admin account by opening a command shell as Administrator and typing

net user administrator /active:yes
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.