forked from X9VoiD/TabletDriverCleanup
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdump.bat
More file actions
40 lines (27 loc) · 1016 Bytes
/
dump.bat
File metadata and controls
40 lines (27 loc) · 1016 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
@echo off
setlocal EnableDelayedExpansion
cd /D "%~dp0"
:: Define CR to contain a carriage return (0x0D)
for /f %%A in ('copy /Z "%~dpf0" nul') do set "CR=%%A"
:: Dump
tabletdrivercleanup.exe --dump
pnputil /enum-drivers > .\dumps\pnputil_drivers.txt
pnputil /enum-devices /connected /drivers > .\dumps\pnputil_devices.txt
mkdir ".\dumps\DriverStore" 2>nul
for /D %%G in ("C:\Windows\System32\DriverStore\FileRepository\*") DO (
mkdir ".\dumps\DriverStore\%%~nxG" 2>nul
for /F %%H in ("%%~G\*.inf") DO (
xcopy /Q /Y "%%~H" ".\dumps\DriverStore\%%~nxG" >nul
<nul set /p "=Dumped '%%~nxH' !CR!"
)
)
<nul set /p "=Dumped INF files !CR!"
echo Dumped INF files
set "srcDir=.\dumps"
set "destZip=.\dumps.zip"
if exist "%destZip%" del "%destZip%"
powershell -nologo -noprofile -command "& { Compress-Archive -Path '%srcDir%' -DestinationPath '%destZip%' }"
echo Created '%destZip%'
rd /s /q .\dumps
echo Done
pause