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
 


#5
Sorry it took so long family maters. I am removing a main2 user directory This command

CALCS C:\Users\username/T /E /G user:F

Would I type the above like this

CACLS C:\users\main2 /T /E /G home:F

Do I under stand this part of the command user:F above?
 


Neemobeer

Windows Forum Team
Staff member
#6
Yes
 


#7
after the CACLS I ran this


C:\Windows\System32>rmdir /S /Q C:\users\main2

and got this what am I going wrong here?

C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\Cache\data_0 - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\Cache\data_1 - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\Cache\data_2 - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\Cache\data_3 - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\Cache\f_000006 - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\Cache\f_00000a - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\Cache\f_00000b - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\Cache\f_00000c - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\Cache\f_00000d - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\Cache\f_00000e - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\Cache\f_00000f - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\Cache\f_000010 - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\Cache\f_000011 - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\Cache\f_000012 - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\Cache\f_000013 - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\Cache\f_000014 - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\Cache\f_000015 - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\Cache\index - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\Cache - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\Cookies - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\Cookies-journal - Access isdenied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\LOCALS~1\https_ipm-provider.
ff.avast.com_0.localstorage - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\LOCALS~1\https_ipm-provider.
ff.avast.com_0.localstorage-journal - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\LOCALS~1\https_local.avast.c
om_0.localstorage - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\LOCALS~1\https_local.avast.c
om_0.localstorage-journal - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\LOCALS~1 - Access is denied.

C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\NCcache.dat - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\NCcacheIpm.dat - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache\Visited Links - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\Cache - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\log - Access is denied.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\remotecache.zip - Access is denied
.
C:\users\main2\AppData\Roaming\AVASTS~1\Avast\uicred2.dat - Access is denied.
 


#8
I decided on not worrying about the users on this system I am building a new system soon. The reason I wanted to is cause one user account had a bad folder as I call it and it was in the music folder. Now on my new user account Home. I have a Dave folder with a subfolder has the same issue this I can see the folder but windows does not and I can not remove it. Plus there is no security info on this folder it states info cannot be displayed. I moved all the data to another folder called David folder and marked that folder as bad and do not use. Something is wrong with either windows or the HDD for this to happen again I never seen this before on windows 7. I did smart test with crystaldiskinfo on the HDD and its all normal. I am finalizing my build for my win10 system. Does anyone have a idea what could cause this type of error? I found out about the bad folder with my backup tool freefilesync which would not copy a file from that folder for the backup.
 


Neemobeer

Windows Forum Team
Staff member
#9
If you didn't run the takeown command first then that's why it's not working. If you did and still getting access denied then it's possible the files are locked by avast, potentially through a filter driver and you'd need to remove that driver first.
 


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