Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uninstalling a driver via batch file

I'm looking for information on whether or not there is a Windows standard way for accomplishing this?

Essentially we have a vendor who has updated their driver and devices running our software must be updated automatically.

In order to do this, we must uninstall the existing driver first (vendor requirement).

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

Also a sample would be very helpful.

Thanks

like image 675
tronious Avatar asked Dec 13 '13 17:12

tronious


2 Answers

wmic sysdriver where "name=drivernamehere" call delete

The syntax above appears to be incorrect. I tried and always got "delete - Invalid alias verb" I looked up the syntax and came up with the following that appears to work:

wmic sysdriver where name="driver_name" delete

I got instance deletion successful but I have to verify whether this completely removes the driver from the system or not.

like image 171
Nilus Dionis Avatar answered Oct 19 '22 23:10

Nilus Dionis


WMIC is best choice for accomplishing this via command line.

wmic sysdriver where name="drivernamehere" call delete

devcon.exe is another alternative for batch.

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

EDIT: Use this to get find the correct name

wmic sysdriver get name
like image 28
Knuckle-Dragger Avatar answered Oct 20 '22 00:10

Knuckle-Dragger