Skip to content

Instantly share code, notes, and snippets.

@zeroxia
Created April 27, 2023 10:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeroxia/7eb9f9f36c032a8ec03b080c5fae595f to your computer and use it in GitHub Desktop.
Save zeroxia/7eb9f9f36c032a8ec03b080c5fae595f to your computer and use it in GitHub Desktop.
Remove zombie "software devices" caused by a bad-behaving LAN media box advertising itself
##
## Some stupid application (like "鲜时光") in Android TV system advertises itself
## with different identities, causing Windows system assuming there are many many
## such software devices.
## You can open "Settings" app and select "Devices" to browse those devices. Or they
## are also listed in "Device Manager" under the category of "Software Devices".
##
## To remove them all together without manually right clicking each instance and
## selecting "Uninstall", here is a PowerShell script stolen from stackoverflow:
##
## https://stackoverflow.com/questions/60638900/uninstall-device-from-powershell
##
## Save this file as "remove_zombie_software_devices.ps1" and execute it with a
## privileged PowerShell terminal (i.e., run as Administrator).
##
## Remember to update the clause "$_.Name -Like "XXX"" in the following line to your
## target zombie device names.
foreach ($dev in (Get-PnpDevice | Where-Object { $_.Name -Like "*我的鲜时光*" } )) {
Write-Host 'Name: '$dev.Name' | InstanceId: '$dev.InstanceId
&"pnputil" /remove-device $dev.InstanceId
&"pnputil" /scan-devices
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment