🖥️ Batch (CMD)

Export Signed Drivers to CSV (Batch)

Uses wmic to export Signed Drivers (Win32_PnPSignedDriver) to a timestamped CSV file.

By WindowsScripting.com · 632 B
ExportPnPSignedDriverToCsv.bat
@echo off
:: ============================================================
:: ExportPnPSignedDriverToCsv.bat
::
:: Exports Signed Drivers (Win32_PnPSignedDriver) to a timestamped CSV file next to
:: this script.
:: ============================================================

setlocal EnableDelayedExpansion
for /f "skip=1 tokens=1-2 delims=." %%a in ('wmic os get localdatetime') do if not defined LDT set LDT=%%a
set "OUTFILE=%~dp0pnpsigneddriver_!LDT:~0,8!-!LDT:~8,6!.csv"

wmic path Win32_PnPSignedDriver get DeviceName,DriverVersion,Manufacturer,DriverDate /format:csv > "%OUTFILE%"

echo Exported to "%OUTFILE%"
endlocal
pause