Removing a driver through a batch file

I am looking for information on whether there is a standard Windows way for this?

Essentially, we have a vendor that has updated its driver, and the devices on which our software is running should update automatically.

To do this, we must first remove the existing driver (vendor requirement).

Any guidance on best practices / approach to this. Details of why this should be done are probably not important. It just needs to be done.

Also, the sample will be very useful.

thanks

+7
windows batch-file uninstall driver runonce
source share
3 answers

WMIC is the best choice for doing this via the command line.

wmic sysdriver where name="drivernamehere" call delete 

devcon.exe is another alternative to the package.

http://support.microsoft.com/kb/311272

EDIT: use this to find the correct name

 wmic sysdriver get name 
+3
source share

wmic sysdriver where "name = drivernamehere" call delete

The syntax above seems to be wrong. I tried and always got "delete - Invalid alias verb" I looked through the syntax and came up with the following, which seems to work:

wmic sysdriver where name = "driver_name" delete

I successfully deleted the delete instance, but I have to check if it completely removes the driver from the system.

+3
source share

Actually, the correct syntax should be as follows:

 wmic sysdriver where(name="driver_name") delete 
+2
source share

All Articles