Installing drivers on your computer is a crucial task that ensures your hardware works optimally. While many users prefer to use GUI-based methods, using the Command Prompt can offer more control and precision. This guide will walk you through the process of installing drivers via Command Prompt, providing a detailed explanation of the commands and parameters used.
Installing drivers via Command Prompt allows for more control and precision compared to GUI-based methods. By using commands like pnputil
and navigating to the driver location, you can easily install drivers on your computer. However, it is not possible to provide a quick answer to the entire process as it involves multiple steps and commands.
- What is Command Prompt?
- Why Use Command Prompt for Driver Installation?
- Preparing for Installation
- Installing Drivers via Command Prompt
- Step 1: Open Command Prompt
- Step 2: Navigate to the Driver Location
- Step 3: Install the Driver
- Step 4: Restart Your System
- Conclusion
What is Command Prompt?
Command Prompt, also known as cmd.exe or cmd, is a command-line interpreter application available in most Windows operating systems. It’s used to execute entered commands, allowing users to automate tasks via scripts and batch files, perform advanced administrative functions, and troubleshoot or solve certain kinds of Windows issues.
Why Use Command Prompt for Driver Installation?
While graphical user interfaces (GUIs) are user-friendly and visually appealing, they don’t always provide the level of control and detail that Command Prompt does. By using Command Prompt, you can directly interact with your system and perform tasks more efficiently.
Preparing for Installation
Before you start, it’s essential to know the exact model of the hardware for which you’re installing the driver. You can usually find this information in the device manager on your system. Once you have this information, you can download the appropriate driver from the manufacturer’s website.
Here’s a step-by-step guide on how to install drivers using the Command Prompt:
Step 1: Open Command Prompt
Press Win + X
and select Command Prompt (Admin)
. This will open the Command Prompt with administrative privileges.
Step 2: Navigate to the Driver Location
Use the cd
command to navigate to the location where the driver is saved. For example, if your driver is saved in a folder named “Drivers” on the desktop, you would type:
cd C:\Users\YourUsername\Desktop\Drivers
Step 3: Install the Driver
Once you’re in the correct directory, you can install the driver. The command to do this will depend on the type of driver file you have. If it’s an .inf
file, you can use the pnputil
command:
pnputil /add-driver .\driver.inf
In this command, pnputil
is a utility that allows you to manage the driver store, and /add-driver
is a parameter that tells the utility to add the specified driver to the driver store. .\driver.inf
is the name of your driver file.
If you’re installing an .exe
file, you can simply type the name of the file:
driver.exe
Step 4: Restart Your System
After the driver has been installed, you may need to restart your system for the changes to take effect. You can do this by clicking on the Start
button and selecting Restart
, or by typing the following command into the Command Prompt:
shutdown /r
In this command, shutdown
is a command that allows you to shut down or restart your computer, and /r
is a parameter that tells the command to restart the computer.
Conclusion
Installing drivers via Command Prompt may seem daunting at first, but with a little practice, you can enjoy the level of control and efficiency it offers. Remember to always download drivers from trusted sources, and ensure they are compatible with your hardware and system to avoid any potential issues.
If you need further assistance, you can refer to the official Microsoft documentation on Command Prompt here.
No, Command Prompt is primarily available on Windows operating systems. Other operating systems may have their own command-line interfaces or methods for installing drivers.
You can usually find the exact model of your hardware in the device manager on your system. To access the device manager, press Win + X
and select «Device Manager» from the menu. In the device manager, expand the category related to your hardware, right-click on the specific device, and select «Properties.» The model information should be listed in the «Details» or «General» tab.
It’s best to download drivers from the manufacturer’s official website. They usually provide the most up-to-date and compatible drivers for their hardware. Avoid downloading drivers from third-party websites, as they may contain malware or outdated versions.
No, you’ll need to install each driver individually using the appropriate command. However, you can navigate to the folder containing multiple driver files and install them one after another.
If the driver installation fails, double-check that you have downloaded the correct driver for your hardware and operating system. Ensure that you have administrative privileges when running Command Prompt. If the issue persists, you can try restarting your system and attempting the installation again. If all else fails, you may need to seek assistance from the hardware manufacturer or a technical support professional.
Yes, you can uninstall drivers using the Command Prompt. You can use the pnputil
command with the /delete-driver
parameter followed by the driver’s .inf
file to remove it from the driver store. For example: pnputil /delete-driver driver.inf
. However, be cautious when uninstalling drivers, as removing the wrong driver can cause issues with your hardware or system.
I am working in Windows 8.1.
I need to install a driver file (.inf
file) from command line. Which command do I need to use?
I know I have many other method for installing a .inf
file, but I must install this from command line.
Please help me
Thanks in advance…
asked Mar 19, 2014 at 5:15
1
Granger’s comment works in Windows 7 too. According to MS, PnPUtil (PnPUtil.exe) is included in every version of Windows, starting with Windows Vista.
It is useful for device drivers that do not have default install (right-click «Install» does not work for them).
pnputil -i -a <driverinf>
answered Dec 20, 2016 at 2:11
Roland PihlakasRoland Pihlakas
4,3462 gold badges43 silver badges65 bronze badges
The default way for device drivers is:
pnputil -i -a <driverinf>
Legacy Drivers can´t be installed with pnputil and have to use LaunchINFSectionEx-Call
I tested the following and it works with several drivers from Windows 2000 up to Windows 10, 2012R2, 2016, 2019.
rundll32.exe advpack.dll,LaunchINFSectionEx ykmd.inf,Yubico64_Install.NT,,4,N
Pay attention to use the correct section
The correct section of the inf-File must be used, when there is no [DefaultInstall]-Section. This lacks in most answers. Look it up in your drivers inf-File and use the correct section (in my example «Yubico64_Install.NT»). Using the wrong section wont prompt an error. Im my example I use Quiet mode, no UI (4) and Never reboot (N) to install the driver automated via GPO. All options are documented in detail here:
https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa768006(v%3Dvs.85)
answered Jul 2, 2019 at 8:55
x0nnx0nn
3161 gold badge3 silver badges7 bronze badges
Download Windows Speedup Tool to fix errors and make PC run faster
The Command Prompt is one utility that many of the power users love to use and have grown with it. If you did not know, it is possible to run Windows Update from the command line. Similarly, it is also possible to install or update drivers using the Command Prompt.
Microsoft offers a built-in utility PnPUtil.exe that allows an administrator to add a driver package, install or update and delete a driver package from the driver store. You can also find out the list of driver packages currently installed in the driver store. In this post, we will show how you can upload drivers using the Command Prompt.
If you want to check you have it, all you need to do is open the command prompt and type PNPUtil.exe and press the Enter key. If there is no error, you are good to go.
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 the computer.
Once done, you can then use the driver with the utility to install or update the driver. You will have to provide the path to the INF file which holds information of 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 <...> | /?]
Here is the syntax, as stated in microsoft.com:
pnputil /add-driver * <filename.inf | .inf> [/subdirs] [/install] [/reboot] /subdirs - traverse sub directories for driver packages. /install - install/update drivers on any matching devices. /reboot - reboot system if needed to complete the operation.
Examples of using the PnPUtil command
You can use the /install option to install a new driver or update an existing one.
Add driver package
pnputil /install x:\driver.inf
Add multiple driver packages
pnputil /install c:\oem\*.inf
Add and install the driver package
pnputil /install device.inf /install
That said, the utility can return information, which can suggest if a reboot is required. If you do not get anything or a zero, all is well. However, if you get ERROR SUCCESS REBOOT REQUIRED
(3010) then a system reboot is required. It happens when the reboot is not used during installation or update. In case a restart is needed, then you will receive ERROR SUCCESS REBOOT INITIATED
(1641) which means the update was successful, and the system reboot is underway.
Related: PnPUtil Failed to delete driver package
The utility can also find or enumerates the driver packages that are currently in the driver store. However, it will only list driver packages that are not in-box packages are listed. An in-box driver package is one that is included in the default installation of Windows or its service packs.
There is another command called Drvload, but it only works in the Windows PE environment, so from a consumer or admin perspective, you will have to use the PnPUtil to update or install a new driver in Windows 11/10.
Read: Unable to install drivers on Windows.
Anand Khanse is the Admin of TheWindowsClub.com, a 10-year Microsoft MVP (2006-16) & a Windows Insider MVP (2016-2022). Please read the entire post & the comments first, create a System Restore Point before making any changes to your system & be careful about any 3rd-party offers while installing freeware.
This topic is a how to. Please keep it as clear and simple as possible. Avoid speculative discussions as well as deep dive into underlying mechanisms or related technologies. |
(what is this box?)
Generally speaking, the best tool to manage device drivers is “Device Manager”. That is a GUI snap-in for
Microsoft Management Console (MMC). You can start it by launching
devmgmt.msc. But that’s not an option in some specific cases, namely:
- Scripting.
- Windows Server installed in Server Core option.
In these cases, you need a command-line tool. Microsoft provides two such tools that differ both in their capabilities and availability.
Plug-and-Play (PnP) Utility (PNPUtil.exe)
Basic Features:
- List drivers — PNPUTIL.EXE -e
- Add driver.
- Install driver.
- Remove driver.
Pros:
- Included out of the box with all current Windows versions.
- Syntax complexity is medium.
Cons:
- Does not provide advanced functionality such as:
- Disable device.
- Select one specific driver for a specific device from the list of compatible drivers that are currently installed in the system.
Availability:
-
Inbox with all current Windows versions.
More information:
- For a detailed description, comprehensive list of features, syntax and command-line examples please see official documentation at
PnPUtil.
Device Console (DevCon.exe)
Features (also Pros):
- All device and driver management functionality that can be found in Device Management MMC including advanced functionality such as:
- Disable device.
- Select one specific driver for a specific device from the list of compatible drivers that are currently installed in the system.
Cons:
- Not available out-of-the box.
- Syntax complexity is high.
Availability:
- See How to Obtain the Current Version of Device Console Utility (DevCon.exe) for detailed instructions.
More information:
-
For a detailed description, comprehensive list of features, syntax and command-line examples please see official documentation at DevCon.
Links
Other Languages
- How to Manage Device Drivers with Command Line (en-US)
- Управление драйверами устройств из командной строки (ru-RU)
- How to Manage Device Drivers with Command Line (en-US)
- Управление драйверами устройств из командной строки (ru-RU)
Windows operating system contains a tool that allows manipulation with system drivers stored in .INF and .CAT files. The operation requires Administrator privileges.
Command to install the driver:
pnputil /add-driver my-driver.inf /install
The correct installation display the following result:
Microsoft PnP Utility Adding driver package: my-driver.inf Driver package added successfully. Published Name: oem3.inf Total driver packages: 1 Added driver packages: 1
To verify the result you can plug the device and it should pick the correct driver. The system copied content from my-driver.inf to C:\Windows\INF\oem3.inf. The number in file name might be different.
The remove the driver from the system and perform uninstallation of the driver from devices type following command:
pnputil /remove-driver my-driver.inf /uninstall
Expected result:
Microsoft PnP Utility Driver package deleted successfully.
No votes yet.
Please wait…
3. May 2021 at 7:10 — Development (Tags: driver, Windows).
Both comments and pings are currently closed.