The process cannot access the file because it is being used by another process windows

In this post, we are going to discuss on “How to Fix The process cannot access the file because it is being used by another process error in Windows 10”. You will be guided here with easy steps/methods to resolve the error. Let’s starts the discussion.

‘The process cannot access the file because it is being used by another process’ error: It is common Windows problem occurred of Windows Operating System version including Windows Vista, Windows 7, Windows 8.1, Windows 10 and on various Windows Server versions. This error is usually appeared when you try to run ‘Netsh’ Command in your Windows computer. Some users reported that this error is appeared when they try to right-click a website in IIS (Internet Information Services) MMC (Microsoft Management Console) snap-in.

There could be several reasons behind this error including required administrator permission that you haven’t given to the command like Netsh command you want to run. You should make sure you are running Netsh Command with administrative permission. If your computer is running IIS (Internet Information Services) but not using port 80 or port 443 because these ports are used by some other processes, then you can face ‘The process cannot access the file because it is being used by another process’ error.

This error can also be occurred if certain registry keys/subkey is not properly configured. You face this error with IIS (Internet Information Services) in your Windows computer usually when ‘ListenOnlyList’ registry subkey is not configured properly. You can re-configure or modify this registry subkey in order to fix the issue. Let’s go for the solution.

How to fix The process cannot access the file because it is being used by another process in Windows 10?

Method 1: Fix Windows PC issues with ‘PC Repair Tool’

If this error is occurred due to some problems in your Windows computer, then you can try to fix the issue with ‘PC Repair Tool’. This software offers you to find and fix BSOD errors, EXE errors, DLL errors, problems with programs/applications, malware or viruses issues, system files or registry issues and other system issues with just few clicks. You can get this tool through button/link below.

Method 2: Run Netsh Command with Admin permission

Netsh Command – This command allows you to display or modify the network configuration of computer that is currently running. However, if you face error while trying to run this command in Command Prompt, then make sure the command is running with administrator permission means you have opened Command Prompt with administrator permission. Try this, and check if the error is resolved.

Step 1: Press ‘Windows + X’ keys on keyboard and select ‘Command Prompt as Administrator’.

Step 2: In ‘Command Prompt with Administrator permission’ opened, type the command that was causing error or type ‘netsh’ command and hit ‘Enter’ key to execute

Step 3: Please check if this command executes and error is resolved.

Method 3: Set a different IP range

Sometimes, error occurred with Netsh command is due to conflict with DNS. You can try to fix the issue by try different IP range instead of creating an exclusion range. To do so, open ‘Command Prompt as Administrator’ using ‘step 1’ of above method, and enter the following commands one-by-one to resolve DNS conflict issue.

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

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

Method 4: Fix Internet Information Services (IIS) port conflict issue

As mentioned, the issue with IIS (Internet Information Services) is occurred due to port conflict issue. You can use ‘Netstat.exe’ utility to check out if another process is using port 80 and port 443.

How to run Netstat.exe utility and check if another process is using Port 80 and port 443?

Step 1: Open ‘Command Prompt as Administrator‘ using ‘Method 2’

Step 2: Now, type ‘netstat – ano’ command and hit ‘Enter’ key to execute. This will start Netstat.exe utility

Step 3: From the results appear, scroll through lists of ‘Active Connections’ and check whether the ports 80 and 443 are being actively used by different process. If yes, then follow next steps

Step 4: Close Command Prompt and press ‘Windows + R’ keys on keyboard, type ‘regedit’ in the opened ‘Run’ dialog box and hit ‘OK’ button to open ‘Registry Editor’

Step 5: In ‘Registry Editor’, navigate to following path in left pane

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

Step 6: Find and modify ‘ListenOnlyList’ registry subkey in right pane but before that you will need to stop ‘HTTP Service’ that is running IIS. So, you need to skip this step this time and once HTTP service stepped, try modifying ListenOnlyList registry subkey.

Step 7: To stop HTTP Service, open ‘Command Prompt as Administrator’ using ‘Method 2’, type ‘net stop http’ command and hit ‘Enter’ key to execute, press ‘Y’ key and hit ‘Enter’ key if asked for confirmation. This will disable HTTP Service.

Step 8: Now, back to ‘step 6’ means inside ‘HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters\ListenOnlyList’ inside ‘Registry Editor’, and find and select ‘ListenOnlyList’ subkey, and in right-pane look towards IP address and check if it is valid IP address, you can delete it or modify it to reflect an entry with valid IP address. If you can’t see ‘ListenOnlyList’ subkey, then there is no need to create one as IP address of 0.0.0.0 will be used by default.

Step 9: Once done, close ‘Registry Editor’ and restart your computer

Step 10: After restart, you need to start HTTP service and to do so, open ‘Command Prompt as Administrator’ again, and this type enter ‘net start http’ command to start HTTP service. Once you hit ‘Enter’ key after entering command, it shows ‘The requested service has been already started’ means you have successfully started HTTP service

Step 11: Now, try running IIS (Internet Information Services) again and check if the error is resolved.

Conclusion

I am sure this post helped you on How to fix The process cannot access the file because it is being used by another process error in Windows 10 with several easy steps/methods. You can read & follow our instructions to do so. That’s all. For any suggestions or queries, please write on comment box below.

Several Windows users are encountering the “The process cannot access the file because it is being used by another process” error. Most of the time, the issue occurs when the user tries to run a netsh command. Some users are reporting that for them, the error message appears when they try to right-click a website in the IIS (Internet Information Services ) MMC (Microsoft Management Console) snap-in.

The process cannot access the file because it is being used by another process

The issue is reported to occur on Windows Vista, Windows 7, Windows 8.1, Windows 10 and on various Windows Server versions.

What causes the process to be used by another process?

We investigated this particular issue by looking at various user reports and the repair strategies that they used to get the issue resolved. Based on what we were able to gather, there are several common scenarios that will trigger this particular error message:

  • The command requires admin privileges – If you’re encountering the error inside a terminal, it’s most likely because you don’t have administrative privileges to make the modifications. Several users in a similar situation have managed to get the issue resolved by granting admin privileges.
  • Another process is using port 80 or port 443 – This is typical with computers running IIS (Internet Information Services). If another process is using these two ports, you will see this error message.
  • The ListenOnlyList registry subkey is not configured correctly – Another common scenario with IIS (Internet Information services) that will trigger this particular error is an incorrectly configured ListenOnlyList registry subkey.

If you’re currently struggling to resolve this particular error message, this article will provide you with a collection of verified troubleshooting steps. Down below, you have a collection of methods that other users in a similar situation have used to get the issue resolved.

For the best results, follow the methods below in order until you encounter a fix that is effective in resolving the error in your particular scenario.

Let’s begin!

Method 1: Running the command with admin privileges

If you’re getting this error when trying to run a netsh command, it’s likely that the error is occurring because you don’t have admin privileges. This is reported to occur more than often when the user tries to run a command that adds exclusions to the dynamic port range for native Windows apps or 3rd party application.

Keep in mind that an operation of this kind will require administrator privileges. To ensure that the CMD window you’re trying to perform the action in has admin privileges, follow the steps below:

  1. Press Windows key + R to open up a Run dialog box. Then, type “cmd” and press Ctrl + Shift + Enter to open up an elevated Command Prompt.
    Opening an elevated Command Prompt window
  2. When prompted by the UAC (User Account Control), click Yes to grant admin privileges.
  3. In the elevated Command Prompt, run the command again and see if you’re still encountering the same error message.

If you’re still getting the  “The process cannot access the file because it is being used by another process” error or this scenario wasn’t applicable, move down to the next method below.

Method 2: Setting a different IP  range

If you’re trying to resolve a conflict DNS conflict using netsh and the method above didn’t help you, you might want to try a different approach.

Several users struggling to resolve the same error message have found that the conflict is resolved after they tried to set a completely different IP range instead of creating an exclusion range.

Below you have a couple of commands that one affected user successfully ran to resolve a conflict between DNS and Quickbooks:

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

Note: Ensure that the terminal you’re running the command in has admin privileges.

If this method didn’t resolve the conflict or wasn’t applicable to the situation that you’re encountering, move down to the final method.

Method 3: Resolving the IIS port conflict

If you are encountering the issue while trying to right-click a website item inside the IIS MMC snap-in (clicking Start doesn’t do anything), you’ll need to use the Netstat.exe utility to figure out if another process is using port 80 and port 443.

This issue is quite common with computers running Microsoft IIS 6.0 and 7.0. Based on the official Microsoft documentation, the error message will appear if one of the following conditions are applicable to your current situation:

  • The ListenOnlyList registry subkey is not configured correctly on the IIS running computer.
  • Another process is using the TCP port (80) or the SSL port (443) required by the IIS.

To resolve this issue, we’ll need to deploy the Netstat.exe utility in order to determine if another process is using the ports specified above. If the utility determines that the ports are not being used, we’ll examine the ListenOnlyList subkey to see if it’s correctly configured.

Here’s a step-by-step guide through the whole thing:

  1. Press Windows key + R to open up a Run dialog box. Then, type “cmd” and press Ctrl + Shift + Enter to open up an elevated Command Prompt. When prompted by the UAC (User Account Control), click Yes to grant administrative privileges.
    Opening an elevated Command Prompt window
  2. Inside the elevated command prompt, run the following command to start the Netstat.exe utility:
    netstat -ano
  3. Once you get a return, scroll through the list of Active Connections and verify whether the ports 50 and 443 are being actively used by a different process.
    Verifying if the ports are being used by a different process

    Note: If the ports are being actively used by a different process, you’ve just managed to identify the source of your problem. In this case, look online for specific steps on how to resolve the port conflict according to the PID of the port.

  4. Close the elevated Command Prompt as we won’t need admin privileges for the next steps.
  5. If the ports aren’t actively used, press Windows key + R to open up a Run dialog box. Then, type ‘regedit‘ and press Enter to open the Registry Editor. When prompted by the UAC (User account control), click Yes to grant administrative privileges.
    Opening the Registry Editor utility
  6. Inside the Registry editor, use the left pane to navigate to the following location:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters\ListenOnlyList

    Note: In case the ListenOnlyList subkey is not present, there’s no need to create one as an IP address of 0.0.0.0 will be used by default.

  7. Before you go ahead and modify the ListenOnlyList subkey, you’ll need to stop the HTTP service that is running the IIS. So put the Registry Editor in the background as we’ll return to it in a moment.
  8. Next, press Windows key + R to open a Run dialog box, type ‘cmd‘ and press Enter to open another Command Prompt window.
    Run dialog: cmd
  9. In the Cmd prompt, run the following command and press Enter to stop the HTTP service responsible for running the IIS:
    net stop http
  10. When asked whether you want to continue this operation, type ‘Y’ and press Enter to confirm the operation.
    Disabling the HTTP Service
  11. Once the HTTP service is disabled, close the Command Prompt window and return to the Registry Editor.
  12. With the ListenOnlyList subkey selected, move over to the right-hand pane and ensure that it contains valid IP addresses. If you spot an IP address that isn’t valid, remove it or modify it to reflect an entry with a valid IP address.
    Deleting the Binary values with invalid IPs

    Note: In case the ListenOnlyList subkey is present and the 0.0.0.0 address is listed, you need to delete all the other IP addresses.

  13. Close Registry Editor and restart your computer.
  14. At the next startup, the HTTP service should be automatically started. But just to make sure, press Windows key + R to open up another Run dialog box. Then, type “cmd” and press Enter to open a Command Prompt window.
    Opening a normal Command Prompt window
  15. In the newly opened Command Prompt, type the following command to ensure that the HTTP service is started:
    net start http

    Note: If you get returned a message saying that “The requested service has been already started” you are good to go.

  16. Attempt to start a service from the Microsoft Internet Information Services (IIS) Microsoft Management Console (MMC) snap-in. You should no longer encounter the ‘process cannot access the file because it is being used by another process’ error.

Photo of Kevin Arrows

Kevin Arrows

Kevin Arrows is a highly experienced and knowledgeable technology specialist with over a decade of industry experience. He holds a Microsoft Certified Technology Specialist (MCTS) certification and has a deep passion for staying up-to-date on the latest tech developments. Kevin has written extensively on a wide range of tech-related topics, showcasing his expertise and knowledge in areas such as software development, cybersecurity, and cloud computing. His contributions to the tech field have been widely recognized and respected by his peers, and he is highly regarded for his ability to explain complex technical concepts in a clear and concise manner.

A lot of users receive the “The process cannot access the file because it is being used by another process.error when using certain programs. Don’t worry. This post of MiniTool will analyze the possible causes and provide corresponding fixes.

According to user reports, the “the process cannot access the file because it is being used by another process write to disk” error can occur with certain apps such as BitTorrent and uTorrent. This error often appears when trying to download/write a file via the torrent client. Here’s a true example from the stackoverflow.com forum:

BitTorrent: The process cannot access the file ‘file path’ because it is being used by another process. I have some code and when it executes. What does this mean, and what can I do about it?

https://stackoverflow.com/questions/26741191/ioexception-the-process-cannot-access-the-file-file-path-because-it-is-being

the process cannot access the file because it is being used by another process

The Process Cannot Access The File Because It Is Being Used by Another Process?

What causes the “uTorrent the process cannot access the file because it is being used by another process” error? As the error message suggests, the main reason is related to the interfering processes. This situation is often caused by a Finder, Windows Explorer, and ISO mounting software.

If the torrent file is downloaded in cloud storage apps like OneDrive, Dropbox, and Google Drive, you may also encounter the error. In addition, third-party antivirus software and even Firewall blocks can trigger the “The process cannot access the file because it is being used by another process BitTorrent” error.

How to Fix the “The Process Cannot Access The File Used by Another Process” Error

After analyzing extensive user reports and references, we summarize the 5 proven ways below to fix the “The process cannot access the file because it is being used by another process write to disk” error. Let’s start trying.

# 1. Close All Interfering Applications

The first and simplest solution is to close all conflicting apps and programs in Task Manager. Here you should end the process that is writing data to the same files as you encounter the error.

Step 1. Press Ctrl + Shift + Esc keys to open the Task Manager window.

Step 2. In the Process tab, right-click the conflicting process like Finder and select End task. Then repeat this procedure to end other processes.

select End task

Once done, you can redownload the file and check if the “error the process cannot access the file because it is being used by another process” message disappears.

# 2. Restart the Torrent Client or Your System

Some users reported that the “The process cannot access the file because it is being used by another process BitTorrent” error can be solved by a simple restart. Here you can try restarting the torrent client and see if it works. If the error persists, restarting your system may help you fix the error.

# 3. Check the Firewall or Antivirus Software Interference

Sometimes your antivirus software and even Firewall can block the torrent client from downloading the file. In this case, you can allow the BitTorrent or uTorrent program through your security software. Here’s how.

 Step 1. Type firewall in the search box and then select the Windows Defender Firewall from the context menu.

Step 2. Click on Allow an app or feature through Windows Defender Firewall from the left pane.

Allow an app or feature through Windows Defender Firewall

Step 3. Select the checkbox of BitTorrent or related programs and check the boxes next to both Private and Public. Then click OK to save changes.

Tips:

For Avast, you can read this post to add the torrent program to its exclusion. For AVG antivirus, navigate to Home > Settings > Components > Web Shield > Exceptions to add the program to the exceptions list. For Kaspersky, navigate to Home > Settings > Additional > Threats and Exclusions > Exclusions > Specify Trusted Applications > Add.

Step 4. Redownload the file and check if the error gets fixed. If persists, you can try disabling the Firewall or antivirus software temporarily and see if it works.

# 4. Add the File to the Exclusions of the Windows Security

In addition, you can try adding the affected file/folder of BitTorrent to the exclusion list of the Windows security program. Here’s how to do that:

Step 1. Type virus in the search box and click the Virus & threat protection app from the top result.

select Virus and threat protection

Step 2. In the Windows Security menu, click on Manage Settings from the right panel.

click Manage settings on Windows security

Step 3. Scroll down to the Exclusions section, and then click on Add or remove exclusions.

click Add or remove exclusions

Step 4. Click on Yes when you are prompted to continue, and then click on Add an exclusion and select Folder/File.

click Add an exclusion

Step 5. Navigate to the file/folder you want to download from the torrent client and click on Select folder. Once you exclude the file from your Windows Firewall, you can redownload and check if the “uTorrent the process cannot access the file because it is being used by another process” error gets fixed.

# 5. Redownload the File Outside the Cloud Folders

If you are trying to download the file in a location used by a cloud storage service like OneDrive, you may encounter the BitTorrent file accesses denied error. To avoid the conflict between BitTorrent and cloud storage, we recommend you download the file outside the cloud folder.

Step 1. Open the BitTorrent client, right-click on the torrent file that triggers the error and select Remove And > Delete Torrent + Data. Then click on Yes to confirm it.

Step 2. Double-click the torrent file again and select a different location to save the downloaded file. At this time, the problem should be resolved.

Further readingIf you enter some issues like file system corruption and low disk space on Windows 10/11, don’t worry. MiniTool Partition Wizard can help you fix them easily by checking file system errors, extending/resizing partitions, analyzing disk space, upgrading to a larger hard disk, etc.

Sometimes, a single file can be used by multiple applications and other processes. At other times, not so much. This is when you are likely to encounter the error message “The process cannot access the file [File Path] because it is being used by another process.”

The error statement suggests that the issue occurred because the file is busy and currently in use by another process. It makes sense and can easily be fixed by retrying the task when the file is free from its initial use. However, that is not always the case.

This error can also occur because of other reasons. Moreover, multiple instances have been reported when the aforementioned error occurs. For example, a user reported that the “The process cannot access the file” error occurred while trying to run a piece of code. In other instances, it was found that this error also occurs while using BitTorrent and uTorrent applications.

Regardless of where this issue occurred, under whichever circumstances, the solutions given below to mitigate the problem should surely work for you.

Table of contents

  • What Causes «The Process Cannot Access The File» Error
  • Fix “The Process Cannot Access The File Used by Another Process”
    • Close Interfering Process
    • Run the Program with Administrative Privileges
    • Disable all Security Software
    • Add File/Folder to Windows Security Exclusion
    • Allow App through Firewall
    • Restart Torrent Client Software
    • Perform a Local Torrent Download
    • Set a different IP Range when using Netsh Command
    • Fix IIS Port Conflict
  • Final Thoughts

What Causes “The Process Cannot Access The File” Error

As we mentioned earlier there is not just one reason for the error to occur. Apart from the fact that the file may actually be busy elsewhere, other factors can cause the said error.

  • Administrative privileges may be required

    If you encountered the error while trying to run a command inside a Command Line Interface (CLI) or an Integrated Development Environment (IDE), it may be possible that you do not have the required privileges to access the file. This would result in the “The process cannot access the file [File Path] because it is being used by another process” error.

  • Another process is using the file

    The file may actually be busy performing another action and may be inaccessible during that time.

  • The “ListenOnlyList” Registry key is configured incorrectly

    If you encountered the error while trying to right-click a site in IIS Manager, then there might be an issue with the associated Windows Registry key.

  • The file is being blocked by a security software

    It may be possible that security software, such as Windows Security or third-party antivirus, may be blocking the file from being accessed, resulting in the error message.

  • Store the file locally

    If the error is occurring due to the fact that a file is downloading from a torrent client into a location shared with online storage, it can cause a conflict between them. Try changing the download location to a non-cloud storage space to resolve the issue.

These are the probable causes for the “The process cannot access the file [File Path] because it is being used by another process” error.

Let us now continue to see how to resolve it.

Fix “The Process Cannot Access The File Used by Another Process”

Close Interfering Process

The error message itself states that the issue is occurring because a file is being used by another process. It only makes sense to close the other process interfering with your work.

That said, the error prompt does not state which process or app is interfering with the file. Therefore, you should close all relevant apps and programs that may relate to the file.

You can close the interfering apps and processes using the Task Manager:

  1. Open the Task Manager by pressing the CTRL + Shift + Esc shortcut keys.

  2. In the Process tab, right-click the app/process you think may be interfering with the file and click “End task.”

    End interfering task from Task Manager

    End interfering task from Task Manager

We suggest that you close all apps and processes using the steps above that are not in use. This will reduce the risk of the error occurring again.

Once closed, re-perform the task and check if the issue has been mitigated. If it persists, continue to perform the remaining mitigation tasks below.

Run the Program with Administrative Privileges

If you encounter the “The process cannot access the file [File Path] because it is being used by another process” error while attempting to run a piece of code in an IDE or a command line, then try running the app/program with elevated privileges.

Limited rights over the file can cause the said error to occur. Therefore, running it as an administrator may do the trick.

You can run an app or a program with elevated privileges using a keyboard shortcut. Press the CTRL + Shift keys from the keyboard and then double-click the app icon. Alternatively, you can also use the Task Manager to run a process/exe file as an administrator:

  1. Open the Task Manager by pressing the CTRL + Shift + Esc shortcut keys.

  2. Click “Run new task.”

    Run a new task

    Run a new task
  3. Enter the file name or the complete path to the program, check the box next to “Create this task with administrative privileges” and click Ok.

    Run program with elevated privileges from Task Manager

    Run a program with elevated privileges from Task Manager

Both of these methods will open the app as an admin, but only temporarily. To learn more methods (permanent and temporary) to run a program as an administrator, refer to this guide post.

Disable all Security Software

Security software, such as Windows Defender or third-party antivirus, may be blocking the file from being accessed, resulting in you not being able to act on it. Try disabling all security software on your Windows computer, both third-party as well as Windows Security.

If you are using a third-party antivirus software, open its console to disable it. To temporarily disable Windows Security, use these steps:

  1. Navigate to the following:

    Settings app >> privacy & security >> Windows Security >> Virus and Threat Protection
  2. Click on the “Manage settings” under the “Virus & threat protection” section.

    Manage virus and threat protection settings

    Manage virus and threat protection settings
  3. Toggle the slider under “Real-time protection” to the Off position.

    Disable real time protection

    Disable real-time protection

    If prompted with a UAC, click Yes.

Now that Windows Security is disabled, try performing the action again to see if you are still prompted with the error message.

If you do not wish to disable Windows Security entirely, you can also add the path to the file to the Windows Security exclusions.

Add File/Folder to Windows Security Exclusion

This solution is an alternative to disabling Windows Security entirely. It can be allied to the complete folder where the file problematic file exists, or to the folder where you are attempting to download a file using a torrent.

Use these steps to add the folder to the Windows security exclusion list:

  1. Go to the following:

    Settings app >> privacy & security >> Windows Security >> Virus and Threat Protection
  2. Click “Manage settings” under Virus & threat protection settings.

    Manage virus and threat protection settings

    Manage virus and threat protection settings
  3. Scroll to the bottom and click “Add or remove exclusions” under the Exclusions section.

    Add or remove Windows Security exclusions

    Add or remove Windows Security exclusions
  4. Click “Add an exclusion,” and then click “Folder” from the expanded menu.

    Add a folder to exclude

    Add a folder to exclude
  5. Now search and select the problematic folder containing the file that causes the error prompt.

Once the folder has been excluded from Windows Security, try performing the task again.

Allow App through Firewall

This solution applies if you are experiencing the error while performing an action on the network, like moving files from one location to another over the network.

It may be possible that your system’s firewall is blocking the app and all of its processes. To fix this, you must allow the app through the firewall. Here is how:

  1. Open Windows Firewall settings by typing in “firewall.cpl” in the Run Command box.

    Open Firewall settings

    Open Firewall settings
  2. Click “Allow an app or feature through Windows Defender Firewall” on the left.

    Allow app through Windows Firewall

    Allow app through Windows Firewall
  3. Click “Change settings.”

    Change firewall settings

    Change firewall settings
  4. Check the boxes for all network types in front of the app throwing the error.

    Allow the app through Windows Firewall

    Allow the app through Windows Firewall
  5. Click “Ok” to save the changes.

    Save and implement the changes

    Save and implement the changes

Once the application has been allowed through Windows Firewall, check to see if the error message has been mitigated and that you are now able to perform the required task.

Restart Torrent Client Software

If you encountered the “The process cannot access the file [File Path] because it is being used by another process” error message while trying to download a torrent file, a simple fix might work.

Restart the torrent client (like BitTorrent or uTorrent) simply by closing it, and then rerun it. This usually fixes the problem as reported by some users.

If this didn’t work for you, then try re-downloading the file to a local location, and not directly to the cloud storage.

Perform a Local Torrent Download

This solution applies if the error is prompted when trying to download a torrent file directly to a cloud location.

If so, try downloading the file locally onto your PC instead, and not on OneDrive, DropBox, or any other cloud storage locations.

For this, you must first delete the torrent and its data, then re-download it locally. Here is how:

  1. Open the torrent client, and right-click on the torrent being downloaded.

  2. From the context menu, expand “Remove and” and then click “Delete torrent + data.”

    This will remove the torrent as well as any data which has already been downloaded.

  3. Now re-download the torrent file and run it.

  4. Select a local download location and begin your download.

Set a different IP Range when using Netsh Command

There are also reports that the “The process cannot access the file because it is being used by another process” error is prompted when attempting to resolve a DNS conflict using the Netsh command. If you find yourself in a similar situation, then try a different approach instead.

Instead of resolving the DNS conflict by excluding an IP or an IP range, try setting a totally different IP range instead.

To do so, you can run the following cmdlets in an elevated terminal:

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

After changing the IP address range, check to see if the error is resolved.

Fix IIS Port Conflict

This solution is for when you are experiencing the aforementioned error while right-clicking a website in the IIS manager. This happens when there is a port conflict. This error has been reported with IIS versions 6.0 and 7.0.

Either one of the following conditions can cause the error:

  • The ListenOnlyList registry subkey is not configured correctly.
  • Another process is using the TCP port (80) or the SSL port (443).

In this case, you must manually change the associated Windows Registry to resolve the issue. But before that, we must check whether ports 80 and 443 are, in fact, being used or not. If they are not in use, then the issue might be something else.

Moreover, we must also temporarily stop the HTTP service on your computer to make changes to the ListenOnlyList key inside the registry.

Use this step-by-step guide to perform the mitigation solution:

Note: Misconfiguration of critical values in the system’s registry could be fatal for your operating system. Therefore, we insist that you create a system restore point before proceeding forward with the process.

You can also use our top selection of disk imaging and backup software so you never lose your data or operating system again.

  1. Run the following command in an elevated Command Prompt to check if ports 80 and 443 are in use:

    netstat -ano
  2. Browse through the resulting list to see if ports 80 and 443 are “LISTENING.”

    Check if ports 80 and 443 are in use

    Check if ports 80 and 443 are in use

    If another process is using the ports, continue to perform the remaining steps below to resolve the port conflict.

  3. Run this cmdlet to stop the HTTP service:

    net stop http

    Stop HTTP service from Command Prompt

    Stop HTTP service from Command Prompt

    When asked for confirmation, enter “Y.”

  4. Now open the Registry Editor by typing in “regedit” in the Run Command box.

    Open the Registry Editor

    Open the Registry Editor
  5. Paste the following in the navigation bar and hit Enter for quick navigation.

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

    Navigate to ListenOnlyList key

    Navigate to the ListenOnlyList key

    Note: If the “ListenOnlyList” key does not exist, creating one is unnecessary as the “0.0.0.0” IP address will be used by default.

  6. Right-click any invalid IP address inside the “ListenOnlyList” key and click “Delete.”

    Delete invalid IPs in ListenOnlyList

    Delete invalid IPs in ListenOnlyList
  7. Once all invalid IP addresses have been removed, restart the computer.

    The HTTP service should also start automatically when the computer reboots.

Once the port conflict is resolved, the “The process cannot access the file” error should be removed as well.

Final Thoughts

The error message reading “The process cannot access the file because it is being used by another process” can be infuriating to resolve. The solutions to resolve this error are entirely dependent on the circumstances and conditions when it was encountered.

In this article, you will find all the possible solutions to resolve the said error, may it be in the IIS manager, or while attempting to download a file through a torrent.

Let us know which solution(s) worked for you in the comments below and when the error first occurred.

I would like to zip a path (with a service windows running inside).

When the service is stopped, it works perfectly, when the service is running, I have the exception:

The process cannot access the file because it is being used by another
process.

However, when I zip with 7-zip, I don’t have any exception.

My command:

Compress-Archive [PATH] -CompressionLevel Optimal -DestinationPath("[DEST_PATH]") -Force

Do you have any idea to perform the task without this exception?

ΩmegaMan's user avatar

ΩmegaMan

29.6k12 gold badges100 silver badges123 bronze badges

asked Nov 13, 2017 at 10:38

Bob's user avatar

6

Copy-Item allows you to access files that are being used in another process.

This is the solution I ended up using in my code:

Copy-Item -Path "C:\Temp\somefolder" -Force -PassThru | 
Get-ChildItem |
Compress-Archive -DestinationPath "C:\Temp\somefolder.zip"

The idea is that you pass through all the copied items through the pipeline instead of having to copy them to a specific destination first before compressing.

I like to zip up a folder’s content rather than the folder itself, therefore I’m using Get-ChildItem before compressing in the last line.

Sub-folders are already included. No need to use -recurse in the first line to do this

Grzegorz Smulko's user avatar

answered Dec 31, 2018 at 15:57

monadwhat's user avatar

monadwhatmonadwhat

791 silver badge3 bronze badges

3

A good method to access files being used by another process is by creating snapshots using Volume Shadow Copy Service.

To do so, one can simply use PowerShells WMI Cmdlets:

$Path = "C:/my/used/folder"
$directoryRoot = [System.IO.Directory]::GetDirectoryRoot($Path).ToString()

$shadow = (Get-WmiObject -List Win32_ShadowCopy).Create($directoryRoot, "ClientAccessible")
$shadowCopy = Get-WmiObject Win32_ShadowCopy | ? { $_.ID -eq $shadow.ShadowID }
$snapshotPath = $shadowCopy.DeviceObject + "\" + $Path.Replace($directoryRoot, "")

Now you can use the $snapshotPath as -Path for your Compress-Archive call.

This method can also be used to create backups with symlinks.
From there on you can use the linked folders to copy backed up files, or to compress them without those Access exceptions.

I created a similiar function and a small Cmdlet in this Gist: Backup.ps1

answered Nov 13, 2017 at 11:11

Clijsters's user avatar

ClijstersClijsters

3,9912 gold badges28 silver badges38 bronze badges

There was a similar requirement where only few extensions needs to be added to zip.
With this approach, we can copy the all files including locked ones to a temp location > Zip the files and then delete the logs

This is bit lengthy process but made my day!

$filedate = Get-Date -Format yyyyMddhhmmss
$zipfile = 'C:\Logs\logfiles'+ $filedate +'.zip'

New-Item -Path "c:\" -Name "Logs" -ItemType "directory" -ErrorAction SilentlyContinue

Robocopy "<Log Location>" "C:\CRLogs\" *.txt *.csv *.log /s
Get-ChildItem -Path "C:\Logs\" -Recurse | Compress-Archive -DestinationPath $zipfile -Force -ErrorAction Continue
Remove-Item -Path "C:\Logs\" -Exclude *.zip -Recurse -Force

answered Nov 14, 2019 at 19:48

Prosenjit Sen's user avatar

  • The problem has been detected and windows has been shut down
  • The mob broke all the shop windows in recent riots
  • The pgadmin 4 server could not be contacted windows 10 ошибка
  • The markc windows 10 mouse acceleration fix
  • The man from the windows