I did a google search and found tools like devcon and devmanview but they are only useful to disable/enable the device not the device driver. What I want to do is be able to disable/enable a particular device driver via command line. Anybody know any tool which can help me do this?
In my case, I actually want to disable/enable a Nvme Mass storage device driver.
Update- I tried using the sc.exe suggested, but I didn't succeed in stopping the driver. Any help?
C:\Users\Administrator>sc query nvme SERVICE_NAME: nvme TYPE : 1 KERNEL_DRIVER STATE : 4 RUNNING (STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN) WIN32_EXIT_CODE : 0 (0x0) SERVICE_EXIT_CODE : 0 (0x0) CHECKPOINT : 0x0 WAIT_HINT : 0x0 C:\Users\Administrator>sc stop nvme [SC] ControlService FAILED 1052: The requested control is not valid for this service.