Example: Use WinPE To Remove A Non-Functional Driver From An Offline 10 / 11 Image
REM List All 3rd-Party Drivers on an Offline Windows 10/11 Image
IF NOT EXIST “C:Scrtch” MKDIR “C:Scrtch”
PowerShell -NoProfile -ExecutionPolicy Bypass -Command “& {Get-WindowsDriver -Path C: -ScratchDirectory C:Scrtch | Sort ProviderName | Format-Table Driver,ProviderName,ClassName,BootCritical,OriginalFileName -AutoSize | Out-String -Stream -Width 32767}”
RMDIR /S /Q “C:Scrtch”
REM Create a UTF-8 Text File That Lists All 3rd-Party Drivers on an Offline Windows 10/11 Image
IF NOT EXIST “C:Scrtch” MKDIR “C:Scrtch”
PowerShell -NoProfile -ExecutionPolicy Bypass -Command “& {Set-Content -Path ‘C:Driver_List.txt’ -value (Get-WindowsDriver -Path C: -ScratchDirectory C:Scrtch | Sort ProviderName | Format-Table Driver,ProviderName,ClassName,BootCritical,OriginalFileName -AutoSize | Out-String -Stream -Width 32767)}”
RMDIR /S /Q “C:Scrtch”
REM Remove a Driver from an Offline Windows 10/11 Image
IF NOT EXIST “C:Scrtch” MKDIR “C:Scrtch”
PowerShell -NoProfile -ExecutionPolicy Bypass -Command “& {Remove-WindowsDriver -Driver oem<NUMBER>.inf -Path C: -ScratchDirectory C:Scrtch}”
RMDIR /S /Q “C:Scrtch”
REM List All 3rd-Party Drivers on an Offline Windows 10/11 Image
IF NOT EXIST “C:Scrtch” MKDIR “C:Scrtch”
PowerShell -NoProfile -ExecutionPolicy Bypass -Command “& {Get-WindowsDriver -Path C: -ScratchDirectory C:Scrtch | Sort ProviderName | Format-Table Driver,ProviderName,ClassName,BootCritical,OriginalFileName -AutoSize | Out-String -Stream -Width 32767}”
RMDIR /S /Q “C:Scrtch”
REM Create a UTF-8 Text File That Lists All 3rd-Party Drivers on an Offline Windows 10/11 Image
IF NOT EXIST “C:Scrtch” MKDIR “C:Scrtch”
PowerShell -NoProfile -ExecutionPolicy Bypass -Command “& {Set-Content -Path ‘C:Driver_List.txt’ -value (Get-WindowsDriver -Path C: -ScratchDirectory C:Scrtch | Sort ProviderName | Format-Table Driver,ProviderName,ClassName,BootCritical,OriginalFileName -AutoSize | Out-String -Stream -Width 32767)}”
RMDIR /S /Q “C:Scrtch”
REM Remove a Driver from an Offline Windows 10/11 Image
IF NOT EXIST “C:Scrtch” MKDIR “C:Scrtch”
PowerShell -NoProfile -ExecutionPolicy Bypass -Command “& {Remove-WindowsDriver -Driver oem<NUMBER>.inf -Path C: -ScratchDirectory C:Scrtch}”
RMDIR /S /Q “C:Scrtch” Read More