You're staring at error code 0X00001B61 and your modem or serial device won't connect. Yeah, that sucks. Let's fix it now.
The Fast Fix: Kill the Process Holding the Port
What's actually happening here is that your serial port (COM1, COM3, etc.) is already opened by another program — maybe a leftover terminal session, a driver helper, or some background app that forgot to release it. Windows won't let two programs open the same COM port at once. So first, find and kill the culprit.
- Download Process Explorer from Microsoft Sysinternals (it's free).
- Run it as Administrator.
- Press Ctrl+F to open the Find Handle or DLL dialog.
- Type your COM port name, like
COM1orCOM3. - Process Explorer will list every process holding a handle to that port. Look for things like
putty.exe,hypertrm.exe,Arduino.exe,serial_monitor.exe, or evensvchost.exe(rare but possible). - Right-click the process and Kill Process.
- Try connecting again.
If the handle shows up under svchost.exe, that's trickier. That means a system service has the port open. In that case, you need to figure out which service — use tasklist /svc in a command prompt to map the PID to a service name, then stop that service or restart it.
Why This Works
The reason step 3 works is that every open file or device in Windows is tracked via a kernel handle. A serial port like COM1 is just a special file (\.\COM1). When a process opens it, that handle is exclusive by default. Windows returns ERROR_ACCESS_DENIED wrapped in the COM subsystem error 0X00001B61 when you try to open it again. So you're not fixing a modem — you're unblocking a resource conflict. Simple once you see it.
If That Didn't Work: Restart the Serial Port Driver
Sometimes no process shows up in Process Explorer, or killing it doesn't release the port. That happens when the driver itself gets stuck in a bad state — think of it as a hung transaction at the hardware level. Here's the fix:
- Open Device Manager (Win+X → Device Manager).
- Expand Ports (COM & LPT).
- Right-click your modem or COM port and select Disable device.
- Wait 5 seconds, then right-click and Enable device.
This tears down the driver stack and rebuilds it fresh. It's the software equivalent of unplugging and re-plugging the cable. I've seen this fix the error on Windows 10 build 22H2 and Windows 11 23H2 after a previous app crashed without closing the port.
Less Common Variations
If the error appears immediately when you plug in your USB-to-serial adapter, the problem might be the adapter's driver itself. Some cheap USB serial adapters (especially those using the CH340 or PL2303 chips) have buggy drivers that claim the port on insertion but never release it. The fix: uninstall the driver from Device Manager (check 'Delete the driver software for this device'), then download the latest driver from the chip manufacturer's site — not the generic Windows update one. For PL2303, avoid version 3.x on Windows 11 — use version 2.0.3.0 instead.
Another scenario: you're running a legacy app like HyperTerminal or an old CNC program. These apps sometimes open the COM port in the background as a "test" connection when they start, even if you haven't used them yet. Check the system tray for any background serial monitor utilities. I had a user once who got this error because a thermal printer driver kept polling COM2 every 30 seconds — invisible until you used Process Explorer.
On Windows Server (2016, 2019), the error can pop up when the Remote Access Service or Routing and Remote Access service grabs a modem port for dial-up. Check those services under services.msc and stop them if you're not actually using dial-up networking.
Prevention
- Always close your terminal app properly — don't just click X. Use the program's "Disconnect" or "Close connection" command. Many apps leave the port open in the background if you force-close them.
- Set a static COM port number for each device. In Device Manager, right-click your USB serial adapter → Properties → Port Settings → Advanced → COM Port Number. Pick a high number like COM9 or COM10. This avoids conflicts with built-in COM ports that Windows might already be reserving.
- If you're writing your own software, always call
CloseHandle()on the serial port handle before your process exits, or use a RAII wrapper. In .NET, wrapSerialPortin ausingblock soDispose()is called even on exceptions. - On Windows 10/11, disable fast startup. It's in Power Options → Choose what the power buttons do. Fast startup can leave driver states cached across reboots, which is a known cause of "port already open" errors after a shutdown instead of a full restart. Yes, really.
That's it. You're not fighting the modem — you're fighting a locked door. Now you know how to pick the lock.