Uninstalling a driver via batch file
Asked Answered
T

3

8

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

Tades answered 13/12, 2013 at 17:6 Comment(1)
I'm currently looking at trying to use DevCon. Is there any other way that someone can recommend?Tades
M
3

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
Munguia answered 13/12, 2013 at 18:2 Comment(3)
How about WMIC using the delete method of Win32_SystemDriver.Munguia
Thanks Knuckle-Dragger. Is WMIC something that I can use as part of a batch? Or would I have to manually open up a command prompt and run it? Basically what I'm trying to accomplish is the following: 1. RunOnce entry 2. Runs a script (batch I guess) 3. Uninstalls existing driver (tablet digitizer driver) 4. Installs new updated driver. Seems strange, but vendor requires that the existing be uninstalled before their script is run to install the updated oneTades
You may want to have a read here. superuser.com/questions/243040/…Munguia
I
4

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.

Impossibility answered 30/4, 2014 at 22:6 Comment(1)
Sounds like you need to do a little additional work before posting this solutionPeder
M
3

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
Munguia answered 13/12, 2013 at 18:2 Comment(3)
How about WMIC using the delete method of Win32_SystemDriver.Munguia
Thanks Knuckle-Dragger. Is WMIC something that I can use as part of a batch? Or would I have to manually open up a command prompt and run it? Basically what I'm trying to accomplish is the following: 1. RunOnce entry 2. Runs a script (batch I guess) 3. Uninstalls existing driver (tablet digitizer driver) 4. Installs new updated driver. Seems strange, but vendor requires that the existing be uninstalled before their script is run to install the updated oneTades
You may want to have a read here. superuser.com/questions/243040/…Munguia
C
2

Actually, the correct syntax should be as follows:

wmic sysdriver where(name="driver_name") delete
Coelho answered 1/9, 2016 at 22:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.