Software⏱️ 3 min read📅 2026-06-11

How to Fix: netsh error: The process cannot access the file because it is being used by another process

Windows Server 2016 Essentials issue with netsh command

Quick Answer: The file being accessed is likely the Windows Firewall configuration file, and the process using it might be a system service or another running application.

The 'netsh error: The process cannot access the file because it is being used by another process' error occurs when attempting to execute the `netsh int ipv4 add excludedportrange protocol=udp startport=55368 numberofports=5` command on a Windows Server 2016 Essentials. This issue affects system administrators and IT professionals who use this command to configure port ranges for IPv4 connections.

This error can be frustrating, especially when working with critical network configurations. However, by following the steps outlined in this guide, you should be able to resolve the issue and successfully execute the `netsh` command.

⚠️ Common Causes

  • The 'process cannot access the file because it is being used by another process' error typically occurs when another process or application has an open handle on a critical system file. In this case, the file being referenced is likely the Windows Network Interface Control (NIC) configuration file.
  • Another possible cause could be a conflict with another network-related service or utility that is using the same port range as intended by the `netsh` command.

🛠️ Step-by-Step Verified Fixes

Force Close and Restart

  1. Step 1: Open Task Manager (Ctrl + Shift + Esc) and identify all running processes. Look for any suspicious or unfamiliar processes that may be consuming system resources.
  2. Step 2: Select the processes you want to close, right-click on them, and choose 'End task'. Be cautious when closing processes, as this may cause data loss or corruption if not done carefully.
  3. Step 3: Once all unnecessary processes are closed, restart your server in safe mode. This will reload the operating system with minimal services running, increasing the chances of resolving the issue.

Check for Conflicting Services

  1. Step 1: Open the Services console (Windows + R, type 'services.msc', and press Enter). Look for any network-related services that may be using the same port range as intended by the `netsh` command.
  2. Step 2: Right-click on each service, select 'Properties', and check the 'Startup type' and 'Port' settings. If a conflicting service is found, you can modify its configuration to use an alternative port or disable it temporarily.

✨ Wrapping Up

To resolve the 'netsh error: The process cannot access the file because it is being used by another process' issue, try forcing close and restarting your server in safe mode. If this doesn't work, check for conflicting network services and modify their configurations to use alternative ports or disable them temporarily. By following these steps, you should be able to successfully execute the `netsh` command and configure your port ranges without issues.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions