How can I install and uninstall a driver from the command line during a console session?

I have the driver.sys and the driver.inf file, and I want to:

  1. install the driver
  2. use the device managed by the driver (software or hardware)
  3. uninstall the driver

DevCon seem to be the option for meeting your needs. DevCon is built to support Windows XP, while pnpUtil is supported in Windows Vista and later so the supposed duplicate question does not apply here since pnpUtil will not work in your case. Once you've downloaded DevCon, and extracted it, open a command prompt to the directory where devcon.exe is located. If you're using a 32-bit version of XP, you'll want to make sure you use the devcon.exe located in the i386 directory and not the one located in ia64 directory. Run the command as follows to install:

devcon install name_of_inf.inf

Use the following to remove a device driver:

devcon remove <hardware_id>

If you're not sure what the hardware_id is for a given device installed use

devcon findall *

| improve this answer | |
  • Pleas expand -- how would the user use DevCon or pnpUtil to perform what he want? – Ƭᴇcʜιᴇ007 Mar 25 '14 at 14:39
  • I'm not 100% positive if XP support is still present in its most recent version, but if it is, that is a viable option as well. Considering DevCon was built for earlier systems pre-Vista, I'd stick with DevCon. – Daniel Chateau Mar 25 '14 at 20:31
  • devcon needs driver id to install – deFreitas Oct 12 '16 at 21:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.