Is there a way to update the network driver by cmd prompt?

JUN-HYEON HAN 1 Reputation point
2022-01-24T03:06:12.73+00:00

ex)

  1. pnputil /add-driver C:\Users\pjm\Desktop\NSIS_\test_folder\drivers\FilterDriver\test.inf/install
  2. rundll32.exe setupapi.dll,InstallHinfSection 128 C:\Users\pjm\Desktop\NSIS_\test_folder\drivers\FilterDriver\test.inf

Both examples are how to update a driver with an .inf file but didn't work in cmd prompt.
So I think there is a way to proceed with the path way in the above picture with cmd prompt to execute .inf.
Is this path way like directory or something? How could I access above picture path way in cmd prompt?

The reason that I update the network driver is that I am making a SDK and it needs driver update for using Ethernet port.
The thing that I want is when installation is being started, not only SDK is installed but also network driver also being updated automatically.
I know the manual way to install network driver newly by using .inf file like I posted on.
However, I want to use the batch file or NSIS to install network driver automatically.
That's why I asked you how could I access path way in cmd prompt.

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,635 questions
Windows 10 Network
Windows 10 Network
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Network: A group of devices that communicate either wirelessly or via a physical connection.
2,316 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 39,511 Reputation points
    2022-01-31T11:47:46.907+00:00

    Hello JUNHYEONHAN-9364,

    Thank you for your question.

    You can try PnPUtil, Microsoft's utility that aims to help with:

    1) Adding a driver package to the driver repository.

    2) Installing a driver package on the computer.

    3) Deleting a driver package from the driver store.

    4) Enumerating the driver packages that are currently in the driver store. Only driver packages that are not boxed packages are listed. A boxed driver package is one that is included in the standard installation of Windows or its service packs.

    This method will not download the driver package from the Internet. You will have to download the package from the OEM website or copy it from USB or storage media and copy it to your computer.

    Once done, you can use the driver with the utility to install or update the driver. You will have to provide the path to the INF file that contains the information for the driver to be installed.

    PnPUtil syntax

    pnputil [/add-driver <...> | /delete driver <...> | /export-driver <...> | /enum-drivers | /disable-device <...> | /enable device <...> | /restart-device <...> | /remove-device <...> | /scan-devices <...> | /enum-devices <...> | /enum-interfaces <...> | /?]

    Examples of using the PnPUtil command

    Add driver package

    pnputil /install x:\driver.inf

    Add multiple driver packages

    pnputil /install c:\oem*.inf

    Add and Install Driver Package

    pnputil /install device.inf /install

    That said, the utility may return information, which may suggest whether a restart is required. If you get nothing or a zero, that's fine. However, if you get ERROR SUCCESS REBOOT REQUIRED(3010), a system reboot is required. This happens when restart is not used during installation or upgrade. If a reboot is required, you will get ERROR SUCCESS REBOOT INITIATED(1641), which means the upgrade was successful and the system reboot is in progress.


    If the answer is helpful, please upvote and accept it as an answer.

    1 person found this answer helpful.
    0 comments No comments