Windows Server
Remove devices or hidden devices on Windows
Remove devices from device manager on windows hidden or not.
Hi everyone i want to explain that how can you uninstall or device and hidden device on windows.
For run this command you need to Windows Device Console devcon.exe tool.
Download devcon from Microsoft
https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/devcon
Run powershell as administrator
- Check the hidden device list on Powershell
Get-PnpDevice -Status UNKNOWN | Out-GridView
2. Take “InstanceId” from the list
- Run devcon /r remove command
devcon /r remove ” if the device is hidden you have to put @ front of instanceid”
Example Command: (Example instanceid) = USB\VID_21EF&PID_B000\533
devcon /r remove "@USB\VID_21EF&PID_B000\533"
Also below script can uninstall hidden device as script .
Save the below command as hiddendeviceuninstall.ps1 and run it
1 2 3 4 5 6 7 8 9 10 11 12 13 |
#Bu script çalıştırıldığında Windows altındaki hidden deviceları driverlarını silmeden kaldırır. <# devcon.exe için: cd windows\build\tools #> <# Get-PnpDevice | Where {$_.status -eq "UNKNOWN" -and $_.FriendlyName -like "*print*"} #> Get-PnpDevice | Where {$_.status -eq "UNKNOWN"} | select-object FriendlyName,InstanceId | foreach { ( $InstId= $_.InstanceId ) $InstId= -join("@",$InstId) <# &".\devcon.exe" find $InstId #> &".\devcon.exe" /r remove $InstId >> C:\HiddenDevDeleted.log } |