IIS Error: The process cannot access the file because it is being used by another process.
Recently in our one of the web servers all the sites using port 80 were stopped and when we tried to restart website it was giving error like process cannot access the file because it is being used by another process. After analyzing and diagnosis and searching on internet for the same problem i have found that it was a problem due to port 80 was used by another process. To solve the problem i have following command which will list IPs,PID(Process ID) and port that used by the process. The command is as below.
From that output you can fine which port is used by which PID(Process Id). And then you can find the process from task manager. Process Id column in task manager is not enabled by default so you can do by View Menu->Select Column a following dialog box will appear.
Select PID (Process Identifier) and press OK.Now process Id will appear in task manager and in task manger go to processes tab where you can find out process by checking process id column then select that process right click->click End Process that will kill that process. Now again try to restart the IIS Site it will restart. In my case it was java updater who is using same port 80 and after killing my IIS Sites were ok. Hope this will help you..