Overview
"The process cannot access the file because it is being used by another process" means something already has the file (or port) locked. This guide explains the common causes and the fixes, from closing the offending process to resolving port conflicts.
Fixing "The process cannot access the file" error.
Key Takeaways
- The file or port is locked by another process.
- Identify and close the interfering process.
- Run as administrator and check security software.
- For port conflicts, change the port or IP range.
Fix 1: Find and Close the Interfering Process
1. Open Task Manager and look for the app using the file; end it.
2. Or use Resource Monitor > CPU > Associated Handles and search the file name to find the locking process.
3. Close that process, then retry your operation.
Fix 2: Run as Administrator
1. Right-click the program and choose "Run as administrator".
2. Accept the UAC prompt.
3. Retry — elevation often resolves access conflicts.
Fix 3: Check Security Software
1. Temporarily pause third-party antivirus that may be scanning the file.
2. Add the file or folder to Windows Security exclusions if it’s repeatedly locked.
3. Re-enable protection after testing.
Fix 4: Allow the App Through the Firewall
1. Open Windows Defender Firewall > Allow an app through firewall.
2. Add or enable your app for the correct network profile.
3. This helps when the error involves network ports.
Fix 5: Resolve Port Conflicts (netsh / IIS)
1. Find what owns the port: netsh http show urlacl or netstat -ano | findstr :<port>
2. Stop the conflicting service, or change your app’s port.
3. For netsh, set a different IP range; for IIS, change the site binding port.
Fix 6: Torrent Clients
1. Restart the torrent client to release locked files.
2. Try a local download path on an NTFS drive.
3. Avoid two clients touching the same file simultaneously.
Troubleshooting
Problem: Can’t find which process locks the file.
Solution: Use Resource Monitor’s "Associated Handles" search, or Microsoft’s Process Explorer (Find > Handle).
Problem: Error returns after closing the app.
Solution: A background service may hold the file — end it in Services or reboot to clear the lock.
Problem: Port already in use.
Solution: Identify the PID with netstat -ano, then end that process or change your port.
Problem: Antivirus keeps locking files.
Solution: Add a targeted exclusion rather than disabling protection entirely.
Conclusion
This error is almost always a lock held by another process or a port conflict. Identify the culprit with Task Manager or Resource Monitor, close it (or run elevated), and for network errors resolve the port/IP conflict — and the file becomes accessible again.
</w:pBdr><w:spacing w:before="220" w:after="40"/></w:pPr><w:r><w:rPr><w:b/><w:bCs/><w:color w:val="0B5394"/><w:sz w:val="21"/><w:szCs w:val="21"/><w:rFonts w:ascii="Calibri" w:cs="Calibri" w:eastAsia="Calibri" w:hAnsi="Calibri"/></w:rPr><w:t xml:space="preserve">About TechHub
This guide is part of the TechHub Knowledge Base. For more step-by-step IT guides and support, visit techhub.com.lk.















