Remove Driver with PowerShell

I would like to remove a driver "video" using a powershell. If not possible then vbscript.

I am able to find if driver is installed:

Get-WmiObject Win32_PnPSignedDriver| select devicename| where {$_.devicename -like "*DameWare Development*"}

THis will return the devicename if installed.

I am not able to find a way to removbe it, or delete it?

I would like to do it without adding any moduals if possible. Need to do this during the MDT build.

Thanks for the help.


  • Edited by Ogeccut 13 hours 39 minutes ago
July 31st, 2015 1:37pm

$x=Get-WmiObject Win32_PnPSignedDriver -filter "DeviceName='AMD Radeon HD 7570'"
$x.delete()		
Free Windows Admin Tool Kit Click here and download it now
July 31st, 2015 4:02pm

getting an error when trying to delete:

xception calling "Delete" with "0" argument(s): "Operation is not valid due to the current state of the object."
At line:1 char:10
+ $x.Delete <<<< ()
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

Thanks for the help

July 31st, 2015 5:16pm

You may have to run the driver vendor's utility to uninstall the driver.  Drivers are generally more than a single object.  They almost always have a variety of files and registry settings that the vendor's installation file (.msi) installs.  That utility will generally have an uninstall option.
Free Windows Admin Tool Kit Click here and download it now
July 31st, 2015 5:56pm

If you want to know how to remove Dameware, you should ask in Thwack Community of SolarWinds.
July 31st, 2015 6:13pm

getting an error when trying to delete:

xception calling "Delete" with "0" argument(s): "Operation is not valid due to the current state of the object."
At line:1 char:10
+ $x.Delete <<<< ()
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

Thanks for the help

First disable the driver then delete it.  As long as it is loaded you cannot delete it.

Free Windows Admin Tool Kit Click here and download it now
July 31st, 2015 8:47pm

Drivers are designed to be deleted by WMI or the driver manager. It is a Windows Logo requirement.

Deleting the driver does not delete the files it just deletes the keys and connections between the OS and the driver.  Remember that drivers are installed from "inf" files stored in the system folder.  All drivers must reside their before than can be installed.  Drivers are owned by Windows. They are not owned by the vendor.  The vendor merely supplies a file that follows the OS rules for accessing the device.  THe vendor may supply other files to support specific software.  In the case of adapter drivers it is just glue between Windows and the adapter.  Many adapters come with sophisticated utilites to monitor and maage the adapter.  These are unnecessary outside of their utility.  If the driver is removed they won't work but they willnot cause an issue either.

With HP printers. You can uninstall everything HP delivers but the drivers will remain.  Once delivered Windows owns them.  If the driveris dleted thenwe can just go in an delete the driver file  and inf.  Multi-part drivers have to be deleted at all layers.

Many vendors will just tell you to remove the adapter and restart the system. They don't supply a program to delete the drivers.  PnP driver willnot load if the device has been removed.  Sometimes it I necessary to delete the device first then try to remove the driver. Disabling a device will have a similar effect.

July 31st, 2015 8:57pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics