Skip to content

Latest commit

 

History

History
75 lines (60 loc) · 3.31 KB

File metadata and controls

75 lines (60 loc) · 3.31 KB

Windex

Signed drivers helper for Windows OS. Windex helps inspect installed drivers and devices, export driver packages, and install .inf files using pnputil.

Features

  • Scan installed signed drivers (Win32_PnPSignedDriver).
  • Scan network adapters and connected devices (Win32_NetworkAdapter, Win32_PnPEntity).
  • Export a single driver or all drivers to a target folder (optionally create .zip archives).
  • Install .inf driver files from a folder using pnputil.

Requirements

  • Windows 10 / 11.
  • .NET runtime compatible with the project.
  • pnputil.exe available on PATH (shipped with Windows).
  • Administrative privileges for driver install/export operations.

Build

  1. Build with IDE:

    • Open the project in your IDE (example: JetBrains Rider).
    • Build the solution to produce the executable (e.g. device.exe).
  2. Build with .NET CLI:

    • Navigate to the project folder.
    • Run dotnet build -c Release to build the project in Release configuration.
    • The executable will be located in bin\Release\netX.Y\ (replace X.Y with the target framework version).

Usage

General usage printed by the tool:

  • windex -g [-dr|-ne|-de] [-e] — scan devices:

    • -dr : Scan all installed drivers.
    • -ne : Scan network adapters.
    • -de : Scan connected devices.
    • -e : Optional: show only devices with errors (applies to -ne and -de).
  • windex -f <INF-Folder> — install all .inf files found under <INF-Folder> using pnputil.

  • windex -e [-a|<device-ID>] <path> [-r <repo>] [-z] — export drivers:

    • -a : Export all drivers.
    • <device-ID> : Export a specific driver by device instance ID.
    • <path> : Target path for exported files (created if missing).
    • -r <repo> : Optional repository URL written to the repo map (works with -a).
    • -z : Export as zip archives.
  • windex -h [-g|-f|-e] — Prints subcommand help.

Examples:

  • Scan all signed drivers:
    • windex -g -dr
  • Scan disconnected or error network adapters:
    • windex -g -ne -e
  • Export all drivers to C:\drivers and create zip archives:
    • windex -e -a C:\drivers -r https://example.com/repo -z
  • Export a specific driver:
    • windex -e "PCI\VEN_1234&DEV_5678" C:\out
  • Install all .inf files under a folder:
    • windex -f C:\missing-infs

Implementation notes

  • CLI entry point and helpers are in Windex/Program.cs.
  • Export logic and SetupAPI interop are implemented in Windex/Windex.cs.
  • Export strategies:
    1. Try to copy from local Driver Store.
    2. Attempt pnputil /export-driver.
    3. Fallback to SetupDi enumeration and registry properties.
  • The installer flow uses pnputil /add-driver "<path>" /install for each .inf.

Permissions & Troubleshooting

  • Most operations require Administrator rights. Run the executable in an elevated shell.
  • If pnputil is not found or fails, ensure Windows components are present and executable is on PATH.
  • Export may fail for drivers that are only available via OEM packages or encrypted locations.

License

  • See repository license file for terms.