Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^4: How do you enable/disable a driver in Windows?

by DrWhy (Chaplain)
on Feb 07, 2007 at 07:14 UTC ( [id://598694]=note: print w/replies, xml ) Need Help??


in reply to Re^3: How do you enable/disable a driver in Windows?
in thread How do you enable/disable a driver in Windows?

Thanks for the detailed information. I'm actually on XP. I may have confused you because I forgot and left out a step; in the hardware tab of the system control panel I click on another button -- 'Device Manager', I think, but I'm on a Mac system right now so I'm still going from memory. I'm interested in a solution that will work on Win2k and above since that is the range of OS's that our software supports.

I'm writing a set of tests for our software to see how it behaves when a USB security hasp is removed/not present. Our software is only supposed to work when the hasp is present.

In doing some more digging around on the internet I found an MSDN article that pointed to a command line utility, devcon, that does most of what the Device Manager control panel does, but from the command line. It can be downloaded here. Should be straightforward to write a perl wrapper around that, much easier than trying to muck with WMI. Curious, though in doing some reading on WMI, my impression was that it was only useful for querying information about the system setup. It didn't seem to me that you could use it to effect changes to the system configuration.

Update: Just noticed that devcon.exe is part of the DDK package you mentioned.

Update: The x64/amd64 version of this tool is not included in the link I mentioned above. It's only available, afaict, as part of the newer Windows Driver Kit.

--DrWhy

"If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."

  • Comment on Re^4: How do you enable/disable a driver in Windows?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://598694]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2025-03-16 13:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When you first encountered Perl, which feature amazed you the most?










    Results (54 votes). Check out past polls.