Jump to content

Install Driver Programatically


Recommended Posts

Hi there,

Can you please reply to me?

I am working on the module in which I need to install driver (PnP or Non PNP ) without using the add hardware wizard.

As of now I am not aware of how to implement such thing. Do you have any idea how to achieve this without using wizard? Is it possible?

Can you please give me some useful link/hint/sample code that I can use in my module.

Requesting you to reply me as this is very new part for me and urgent too.

Thanks in advance for your kind help.

Awaiting your reply.


Link to comment
Share on other sites

Surely it's possible, but I can provide to you only partial info, because never I did driver installation by this way

inly once and I had prepared some *.reg files for importing into registry - not prepared by me.

What kind of driver do you want to install manually ? (graphics, network...)

Kind of driver you want to install is described by "class ID", it is GUID for some type of drivers,

so first you must to find your class ID.

Next in registry you can to find:


and info about your your driver info will be stored under your "class ID" key.

Manual adding driver info here assumes that you very good know what you are doing !

Second place where can be info about your driver is:


Here must be added key with name of your *.sys driver-based service (*.exe services has also keys here)

But this info is not complete, take it only like inspiration what other info you must to find.

If I would be in your role I would to try install this driver by normal way and sniff registry changes by regmon utility,

and with help of captured registry changes I will try to create *.reg files for importing.

Creating of *.reg files can be simpler if you look into *.inf file for your driver installation.

There are registry keys and values which must be added into registry in *.inf file.


Link to comment
Share on other sites

Thanks a lot for the reply.

i was studiying DDK examples and I found that there are API's like UpdateDriverForPlugnPlay and SetupCopyOEM which can be used to

install drivers?

Are these two sufficient for installing driver?

Kindly correct me if I am wrong.

While installing driver,there are certain sections in registry which gets updates (e.g. HKLM\CurrentControlSet\Control\Class

and HKLM\CurrentControlSet\Services whose information is present in .inf file. We need to copy manually INF file to proper location i.e. \\windir\\INF\ and .sys file to \\system32\\drivers.

Is this completes driver instllation process?

My driver type is not fixed. It can be PnP or NonPnp also. I mean it can be ethernet,network,CD,USB or DVD etc..

Do I need to update registry entries and copy file (inf and sys) manually to respective location or above mentioned API's will do this thing? Can ynyone provide some samples?

If devcon can be used for this, How can I know the GUID or Hardware ID or device ID If I know the driver type e.g. USB? How devcon can beused?

Sample code is welcome.

Please help and reply.

Best regards


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.

  • Create New...