By running the command,
you've effectively denied all users access to the folder "foldername", along with their ability to change the permissions of this folder. At this stage, only the owner of that folder can make permission changes to it.
cacls foldername /p everyone:n
If you want to re-gain access to this folder, you will have to first take ownership of it, then proceed to make changes to it's access rules.
N.b. Cacls is now depreciated in favour of the newer Icacls command.
C:\Users\Me\Desktop>takeown /f "foldername"
SUCCESS: The file (or folder): "C:\Users\Me\Desktop\foldername" now owned by
C:\Users\Me\Desktop>icacls "foldername" /grant everyone:(F)
processed file: foldername
Successfully processed 1 files; Failed processing 0 files
You probably created the folder yourself and was therefore the owner of it, able to change it's permissions freely.
Originally Posted by hydranix
For hiding files, I've created a concept of hiding files in plane sight that you might like to check out, over in this thread at Sevenforums.