Need to remove the hidden devices from the device manager through script or pnputil on windows10

Neha Khandelwal 0 Reputation points
2023-05-10T15:04:42.4033333+00:00

Need to remove the hidden devices from the device manager through script or pnputil on windows10

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    2023-05-12T03:27:18.9133333+00:00

    Hi,

    See if this script helps.

    https://github.com/istvans/scripts/blob/master/removeGhosts.ps1

    Please note that some devices may be still required by your OS.

    Best Regards,

    Ian Xue

    If the Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Limitless Technology 44,751 Reputation points
    2023-05-18T07:14:30.43+00:00

    Hello there,

    The below script might help you.

    $deviceName="Insert Device Name Here"
    foreach ($dev in (Get-PnpDevice | Where-Object{$_.Name -eq $deviceName})) {
      &"pnputil" /remove-device $dev.InstanceId 
    }
    pnputil.exe /scan-devices
    

    You can also get sample scripts from here https://github.com/istvans/scripts/blob/master/removeGhosts.ps1

    Hope this resolves your Query !!

    --If the reply is helpful, please Upvote and Accept it as an answer--


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.