To delete files / folder locked by the system.
1.- Locate the folder c:\users\xxx
2.- Try to take ownership of the folder and subfolder : (it will probably failed)
3.- If not failing, give you full rights to the folders and subfolder and delete it.
4.- But since it’s failing, we need to find witch windows process lock the files.
5.- Start Microsoft SysInternal\procexp.exe
6.- Go to find, find handle
7.- Do a search c:\users\xxx
8.- Take not of the PID number that is locking the files (second column)
9.- Go back and Kill process or Kill process tree if it’s a tree.
10.- Go back to the folder and take the owner ship of the folder and subfolder c:\users\xxxx
11.- Give you full rights of the folder and subfolder c:\users\xxx
12.- Delete the c:\users\xxx folder
13.- Log back the user, he will have a fresh new profiles.
How to take owner ship and give you full rights of a folders and subfolders
1.- Locate your c:\users\xxx folder
2.- Right mouse on it | properties | Security | Advanced | Owner | Edit | Choose your ad account | Replace Owner on subcontainers and objects | Apply
3.- Go back to Permissions tab | change permissions | add your ad account | Full control | Replace all child object permissions with inheritable permissions from this object
4.- Now delete your c:\users\xxx folder.