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

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 learning and sharing knowledge.