C:/users folder

#1
I been having issues with removing user folders I go the users directory and I right click and want to remove one folder which I deleted the user account from control panel. I get this message which I attached. I been searching for a solution though none so far.

Thanks
Dave
 


Attachments

Neemobeer

Windows Forum Team
Staff member
#2
It's because you don't have permission. What you'll need to do is first take ownership of the directory and then grant yourself full access.

  • Click on the start menu
  • Type cmd
  • Right click on Command Prompt and select 'Run as Administrator'
  • Type takeown /F C:\Users\username /R (replace username with the directory name you're trying to remove
  • Type the following cacls C:\Users\username /T /E /G user:F replace username with the directory name and user with your username
  • Delete the directory
 


#3
I wanted to just control the user folder. I do not understand this command.

cacls C:\Users\username /T /E /G user:F replace username with the directory name and user with your username.

lets see if I do understand I want to remove maint folder so I would type

cacls C:\Users\maint /T /E /G maint:F <--correct?

Its interesting been building my systems for years but I get struck on the command-line OMG.

I get a lot of results from typing the first command. I was going to attach the out file of the command but extensions not supported is all I got so copy and paste as code.



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data" now owne

d by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\CEF" now owned by user "PC

1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Google" now owned by user

"PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\History" now owned by user

"PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\IconCache.db" now owned by

user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Macromedia" now owned by u

ser "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Microsoft" now owned by us

er "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Mozilla" now owned by user

"PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Temp" now owned by user "P

C1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Temporary Internet Files"

now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\VirtualStore" now owned by

user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data" now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\CEF" now

owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Google" n

ow owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\History"

now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\IconCache

.db" now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Macromedi

a" now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Microsoft

" now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Mozilla"

now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Temp" now

owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Temporary

Internet Files" now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\VirtualSt

ore" now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data\Application Data" now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data\CEF" now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data\Google" now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data\History" now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data\IconCache.db" now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data\Macromedia" now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data\Microsoft" now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data\Mozilla" now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data\Temp" now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data\Temporary Internet Files" now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data\VirtualStore" now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data\Application Data\Application Data" now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data\Application Data\CEF" now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data\Application Data\Google" now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data\Application Data\History" now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data\Application Data\IconCache.db" now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data\Application Data\Macromedia" now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data\Application Data\Microsoft" now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data\Application Data\Mozilla" now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data\Application Data\Temp" now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data\Application Data\Temporary Internet Files" now owned by user "PC1\Home".





SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data\Application Data\VirtualStore" now owned by user "PC1\Home".



INFO: The system cannot find the path specified. ( "C:\Users\maint\AppData\Local

\Application Data\Application Data\Application Data\Application Data\Application

Data\Application Data\Application Data\Application Data\Application Data\Applic

ation Data\Application Data\Application Data\Application Data\Application Data"

)



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data\Application Data\Application Data\CEF" now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data\Application Data\Application Data\Google" now owned by user "PC1\Home".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data\Application Data\Application Data\History" now owned by user "PC1\Home".





INFO: The system cannot find the path specified. ( "C:\Users\maint\AppData\Local

\Application Data\Application Data\Application Data\Application Data\Application

Data\Application Data\Application Data\Application Data\Application Data\Applic

ation Data\Application Data\Application Data\Application Data\IconCache.db" )



INFO: The system cannot find the path specified. ( "C:\Users\maint\AppData\Local

\Application Data\Application Data\Application Data\Application Data\Application

Data\Application Data\Application Data\Application Data\Application Data\Applic

ation Data\Application Data\Application Data\Application Data\Macromedia" )



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data\Application Data\Application Data\Microsoft" now owned by user "PC1\Home

".



SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data\Application Data\Application Data\Mozilla" now owned by user "PC1\Home".





SUCCESS: The file (or folder): "C:\Users\maint\AppData\Local\Application Data\Ap

plication Data\Application Data\Application Data\Application Data\Application Da

ta\Application Data\Application Data\Application Data\Application Data\Applicati

on Data\Application Data\Application Data\Temp" now owned by user "PC1\Home".



INFO: The system cannot find the path specified. ( "C:\Users\maint\AppData\Local

\Application Data\Application Data\Application Data\Application Data\Application

Data\Application Data\Application Data\Application Data\Application Data\Applic

ation Data\Application Data\Application Data\Application Data\Temporary Internet

Files" )



INFO: The system cannot find the path specified. ( "C:\Users\maint\AppData\Local

\Application Data\Application Data\Application Data\Application Data\Application

Data\Application Data\Application Data\Application Data\Application Data\Applic

ation Data\Application Data\Application Data\Application Data\VirtualStore" )



INFO: The system cannot find the path specified. ( "C:\Users\maint\AppData\Local

\Application Data\Application Data\Application Data\Application Data\Application

Data\Application Data\Application Data\Application Data\Application Data\Applic

ation Data\Application Data\Application Data\Application Data\CEF\User Data" )



You do not have permissions to read the contents of directory "C:\Users\maint\Ap

pData\Local\Application Data\Application Data\Application Data\Application Data\

Application Data\Application Data\Application Data\Application Data\Application

Data\Application Data\Application Data\Application Data\Application Data\Google"

.

Do you want to replace the directory permissions with permissions granting you

full control ("Y" for YES, "N" for NO or "C" to CANCEL)?



Do you want to replace the directory permissions with permissions granting you

full control ("Y" for YES, "N" for NO or "C" to CANCEL)?



Do you want to replace the directory permissions with permissions granting you

full control ("Y" for YES, "N" for NO or "C" to CANCEL)?


This look right/
 


Neemobeer

Windows Forum Team
Staff member
#4
Neither of those commands would delete anything. By design Windows uses the DAC ACL model or discretionary access control. When a user profile is created that user is the owner of their user directory. My the DAC design the owner has the discretion to grant access to their directory. Even if you are an administrator you do not have permissions to do anything on another users directory; however, as a member of the administrators group you have the ability to take ownership (the first command TAKEOWN) of their user directory. By the DAC model you now have the ability to grant permissions since you are the owner. After granting access (the second command CACLS) you can then delete the directory if you want either by selecting the directory and press delete. Right clicking the directory and selecting delete or from the command prompt rmdir /S /Q C:\users\maint

A breakdown of the CACLS command

CACLS C:\users\maint /T /E /G user:F
/T means apply the ACL recursively to everything in the path including sub-directories and files in this case C:\users\maint
/E means edit the existing ACL instead of overriding the existing one (if you didn't do this any other access would be removed)
/G means grant /R would be to remove access
user:F is the user the ACL applies to and the :F is the access F denotes full access
 


This website is not affiliated, owned, or endorsed by Microsoft Corporation. It is a member of the Microsoft Partner Program.
Top