Share via

how to remove (COM0)

Anonymous
2025-06-10T07:55:47+00:00

Hi, i have an isue where i plug a lot of devices to windows via USB and windows remembers every usb as hidden, and at some point windows starts assigning (COM0) and some new devices struggle to connect via usb due to (COM0), manually deleting is a chore and takes to much time, is there a way to bulk quickly remove unused saved com ports? since at this point device manager struggles to load and manually uninstall. And maybe there is some kind of option to make windows stop saving useless ports?

Windows for home | Windows 11 | Devices and drivers

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Anonymous
    2025-06-10T15:39:24+00:00

    Hi again, Andrius! Thanks for the detailed follow up! Here are few more steps to try.

    Automate Device Cleanup with a Scheduled Task:

    Since running the CMD version of Device Cleanup Tool takes a long time on your system, you could automate the cleanup process using a scheduled task to run periodically.

    > Create a batch file to remove non-present devices by running the Device Cleanup Tool's CMD version.

    > Schedule it to run at a specific time (e.g., daily or weekly) using Task Scheduler.

    > This method would help automate the cleanup process without you needing to run it manually each time.

    Using PowerShell for Bulk Removal

    If CMD doesn’t work, you can use PowerShell to automate the removal of COM ports. Here’s a script that can help:

    $comPorts = Get-WmiObject Win32_SerialPort | Where-Object { $_.DeviceID -match "COM" }

    foreach ($port in $comPorts) {

    $port.PSBase.Delete()
    

    }

    This will find and delete all the COM ports listed in the system. You can save this script as a .ps1 file and run it with PowerShell as Administrator.

    Forgetting Unused Devices Automatically:

    Unfortunately, Windows doesn't provide an out-of-the-box option to forget unused devices after a set time, but you can reduce the amount of remembered devices by:

    > Disabling Auto-Enumeration of Devices: By adjusting device installation settings:

    > Open Device Installation Settings (type Device Installation Settings in the Start menu).

    > Choose No (your device might not work as expected).

    > This will prevent Windows from automatically remembering newly plugged devices, although it won’t affect already saved ones.

    Please give these steps a try and let me know if they help. If you run into more issues, feel free to provide further details, and I'll continue assisting you!

    Best,

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2025-06-10T10:37:13+00:00

    Thanks, for reply, yes i know this program i use it on other computers, but 1 PC has 120k+ non-present devices, so it takes ages to remove Com ports, and device cleanup program doesn't remove (COM0) and on this PC i can't seem to run CMD version of device cleanup (CMD version removes COM0), i can't thinko of a way to force start CMD version, and still it will take like 2 days or more to remove. Would love option in windows to forget unused devicees immedietly or after a day or two. Tried manually deleting (COM0) but windows could't manage to uninstall it.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2025-06-10T09:36:55+00:00

    Hi there, Andrius! This is Marc. Thanks for reaching out to the community.

    Thanks for providing those details. Based on what you've described, here are a few approaches we can try.

    1. A utility called Device Cleanup Tool from Uwe Sieber allows you to bulk-remove unused, non-present devices, including old COM ports.

    > Download from the official site: https://www.uwe-sieber.de/misc_tools_e.html#dev...

    > Run as Administrator

    > It will list all non-present (disconnected) devices

    > You can sort by device class and delete all unused "Ports (COM & LPT)" entries at once

    1. Clean Up Using Built-in Device Manager

    If you prefer a manual but still bulk method using built-in tools:

    > Open Command Prompt as Administrator

    > Enable view of non-present devices:

    set devmgr_show_nonpresent_devices=1

    start devmgmt.msc

    In Device Manager:

    > Go to View > Show hidden devices

    > Expand Ports (COM & LPT)

    > Right-click and Uninstall any grayed-out or unused COM ports

    Note: This is a non-Microsoft website. The page appears to be providing accurate, safe information. Watch out for ads on the site that may advertise products frequently classified as a PUP (Potentially Unwanted Products). Thoroughly research any product advertised on the site before you decide to download and install it.

    Please try these steps and let me know how it goes. If you run into any issues, just reply back with the details.

    Best regards,

    Was this answer helpful?

    0 comments No comments