Yesterday I came along an issue in which I was not able to reset user’s profile. I was getting below error.
The action can’t be completed because the folder or a file in it is open in another program.
The reason I was getting below error was because there were some files opened from user’s profile which were used by some other processes.
To overcome this I found this utility by Microsoft called Handle. Handle is a utility that displays information about open handles for any process in the system. You can use it to see the programs that have a file open, or to see the object types and names of all the handles of a program.
You don’t need to install this utility. Download this utility from this link. Unzip it and copy it to machine.
Open command prompt and route to the handle folder.
First you need to find the processes associated with your files or folder. For this the command is
Here we can see there is file ccSvcHst.exe used by process with ID 2664.
Now we would close this handle. For this we need handle no which is in hexadecimal and process ID. Here process ID is 2664 and handle no is 1D9C.
Now you can rename the file or folder.
I hope this helps you in closing handles. Cheers J