Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

How to Manage Device Drivers in Windows Using CMD and PowerShell

Managing device drivers is a crucial aspect of maintaining a healthy and efficient Windows operating system. Drivers are essential for hardware components to communicate with the OS. This article will guide you through various methods to manage drivers using Command Prompt (CMD) and PowerShell.

Using Command Prompt (CMD)

1. Viewing Installed Drivers

To list all installed drivers, you can use the driverquery command:

driverquery

For more detailed information, including driver file paths, use:

driverquery /v

2. Exporting Driver List

You can export the list of installed drivers to a text file:

driverquery /fo csv > C:\DriversList.csv

3. Installing a Driver

To install a driver, use the pnputil command. First, place the driver file in a known directory, then execute:

pnputil /add-driver C:\Path\To\Driver.inf /install

4. Uninstalling a Driver

To remove a driver, you need to know the published name of the driver package. List all driver packages with:

pnputil /enum-drivers

Then, uninstall the desired driver:

pnputil /delete-driver oemXX.inf /uninstall

Replace oemXX.inf with the actual published name.

Using PowerShell

1. Viewing Installed Drivers

To list all installed drivers, use the Get-WmiObject cmdlet:

Get-WmiObject Win32_PnPSignedDriver | Select-Object DeviceName, Manufacturer, DriverVersion

2. Exporting Driver List

Export the list of installed drivers to a CSV file:

Get-WmiObject Win32_PnPSignedDriver | Select-Object DeviceName, Manufacturer, DriverVersion | Export-Csv -Path C:\DriversList.csv -NoTypeInformation

3. Installing a Driver

To install a driver using PowerShell, you can use the pnputil command within a script:

Start-Process pnputil -ArgumentList "/add-driver C:\Path\To\Driver.inf /install" -NoNewWindow -Wait

4. Uninstalling a Driver

First, get the list of drivers:

pnputil /enum-drivers

Then, remove the specific driver:

Start-Process pnputil -ArgumentList "/delete-driver oemXX.inf /uninstall" -NoNewWindow -Wait

Replace oemXX.inf with the actual published name.

Summary

Managing drivers via CMD and PowerShell in Windows provides a powerful way to automate and streamline driver management tasks. Whether you are installing, uninstalling, or exporting driver lists, these tools offer flexibility and control over your system's drivers.

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.