The Process Cannot Access the File Error on Windows 11 / 10 Fix

It is known that when any file is being used, it cannot be accessed/changed by any other process. In such cases, when a process tries to open a file, the operating system locks the file to prevent it from being modified by another process.


ADVERTISEMENT

“The process cannot access the file because it is being used by another process” is one such error message that has been observed by many users on their Windows computers. This error is known to occur in the different versions of Windows OS and Windows Server. Normally, this error message has been observed during the use of the Netsh command on the user’s Windows PC. Another situation where this error occurs is when trying to open any service or website in the Internet Information Services (IIS) Microsoft Management Console (MMC) snap-in.

Are you seeing this error message on your system? Then, you have landed in the right post. In this article, we have curated a list of troubleshooting strategies that helped users facing this error to resolve it successfully on their Windows PC.

Solution 1 – Close All Unnecessary Background Processes

 

One of the most basic troubleshooting methods to resolve this error is to close all the unnecessary background processes that are running on your PC via the Task Manager.

 

1. Open the Task Manager by pressing the Ctrl + Shift + Esc keys together on your keyboard.

2. Go to the Processes tab in the Task Manager.

3. Here, select the unnecessary processes that are running in the background on your PC one at a time.

Then, click on the End Task button.

 

Task Manager End Unnecessary Background Apps Min

 

Perform this for all the unnecessary applications that you can see in the Task Manager.

Note: Make sure that you don’t end the processes related to Windows and Microsoft services.

4. Reboot your PC.

After the system starts up, try performing the task that was raising this issue to check if it is fixed.

 

Solution 2 – Run the Application as Administrator

 


ADVERTISEMENT

If the error is encountered while trying to execute the netsh command in the terminal, then it is probable that the command requires administrative privileges to run and make the modifications. So, before running the command, make sure that the Command prompt window that you are using has administrative privileges.

 

1. Open the Run dialog using the Windows + R key combination.

2. Type cmd in the Run box.

Then, just press and hold Ctrl + Shift + Enter keys together to run the Command Prompt as an administrator.

 

Run Box Command Prompt Min

 

3. Click on the Yes button, when the User Account Control prompt appears to grant permissions.

4. Now, try executing the command in the Command Prompt and check if the error is resolved or not.

 

Solution 3 – Modify the IP Range

 

This error can occur if there are some processes on your system that are making use of Port 80 or Port 443. Many users have been able to resolve this conflict by setting a completely different IP range.

 

1. Tap on the Windows key on your keyboard and type the text command prompt in the search box.

Once Command Prompt in the search result is selected, click on Run as administrator on the right side.

 


ADVERTISEMENT


Command Prompt Run As Admin Min

 

2. Once the command prompt opens with admin privileges, type the commands below one after the other and hit Enter to change the IP range for the TCP and UDP ports.

netsh int ipv4 set dynamicport tcp start=10000 num=1000

netsh int ipv4 set dynamicport udp start=10000 num=1000

Command Prompt Modify Ip Range Tcp Udp Min

 

3. Check if this helped resolve the issue that you were facing. If the problem still exists, then move over to the next solution below.

Solution 4 – Resolve IIS Port Conflict By Making Registry Changes

 

To resolve the IIS port conflict, the Netstat.exe utility needs to be run to determine if there is any other active connection to port 80 or port 443. Possible circumstances in which this error message appears is as mentioned below:

  • Configuration of the registry subkey ListenOnlyList is not proper on the computer that is running IIS.
  • Port 80 and port 443 needed by IIS are used by another process.

After using the Netstat.exe utility, if you see there are no active connections by other processes to the above-mentioned ports, then you need to check the ListenOnlyList registry subkey configuration.

 

1. Open the Run box using the Windows and R key combination on your keyboard.

Type cmd and run the Command Prompt with admin privileges by pressing the Ctrl + Shift + Enter keys simultaneously.

 

Run Box Command Prompt Min

 

Click on Yes when prompted by User Account Control.

2. Type the command below and hit Enter to run the Netstat.exe utility.

netstat -ano

The command above returns a list of active connections.

 

Command Prompt Netstat Utility Min

 

Scroll through this list and check if port 80 and port 443 are being used by any other process.

If the ports mentioned above are not being used actively, then you need to make changes to the key in the Registry.

3. Before making any modifications to the Registry, you need to stop the HTTP service that is running the IIS.

Type the command in the Command prompt and hit Enter.

net stop http

4. When you are asked Do you want to continue this operation?, type Y and hit Enter to continue.

Close the command prompt after the HTTP port is disabled.

 

Command Prompt Stop Http Min

 

5. Tap on the Windows key on your keyboard and type registry editor in the Windows search bar.

Click on Registry Editor.

 

Windows Open Registry Editor Min

 

If you are prompted by UAC for granting permissions, then click on Yes.

6. In the Registry Editor window, navigate to the location below or copy and paste it into the navigation bar of the Registry.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters\ListenOnlyList

Note: If you don’t find the ListenOnlyList subkey, then you need not create the subkey as the default IP address 0.0.0.0 will be used.

 

Registry Listenonlylist Subkey Min

 

7. Now, you need to move over to the right side and delete all the IP addresses other than the default value of 0.0.0.0


ADVERTISEMENT

Right-click on each IP address and choose the option Delete.

 

Registry Listenonlylist Subkey Delete Ip Address Other Than Default Min

 

In the window that pops up to confirm the deletion of the subkey, click on Yes.

 

Registry Listenonlylist Subkey Delete Ip Address Confirm Min

 

8. Exit the Registry and reboot your computer.

9. After the system startup, you need to start the HTTP service.

Launch the Command prompt as indicated above.

Type the command below and hit Enter.

net start http

10. Once the HTTP service is started, try running IIS (Internet Information Services) and check if the error is resolved.

 

Command Prompt Start Http Min

 

 

That’s it!

Was this article helpful in resolving “This process cannot access this file error” on your Windows PC? Please let us know your thoughts and opinions in the comments below.

ADVERTISEMENT