If changing the ports doesn’t prevent the mouse cursor from moving randomly, there must be some hardware or software-related issue with your Windows computer. If not, then there must be some issue with that port and you should switch to any other port. You can also check if the USB port you’re connecting to is functioning properly. See if there is no damage to the mouse’s body or its cable. If the above method didn’t work, you can try checking your mouse for physical damage. Physically Inspect the Mouse/Trackpad and Its Connection Once you’re done cleaning your workspace, see if stops drifting your cursor on your screen. You should also check your mouse sensor to ensure there are no dust particles that may obstruct its movement or accuracy. Your desk surface, mouse pad, or trackpad may attract dust or oil throughout usage and it’s best to keep those things neat and clean to avoid such circumstances. The most common cause for the cursor moving on its own is a dirty workspace. Clean Your Desk Surface, Mouse Pad or Trackpad
Upgrade Your Mouse to a Newer and Better Model Disable the Touchpad When Using an External Mouse