|
fastslz
铂金会员
       DOS一根葱
积分 5493
发帖 2315
注册 2006-5-1 来自 上海
状态 离线
|
 『楼 主』:
[原创]借助DevCon纯脚本备份驱动,兼容驱动精灵(2008-01-17)
使用 LLM 解释/回答一下
因会员要求 利用纯脚本来安全删除U盘那贴,无意间发现DevCon命令就突发奇想,利用这个命令写个脚本来备份设备驱动。此脚本可以备份全部的设备驱动包括设备管理器中隐藏的设备,就备份项目上超过了大家熟悉的驱动精灵。
更新说明:
不能说此脚本比驱动精灵更完美,但它确实弥补了驱动精灵的不足!
1、支持备份完整的WHQL数字签名(我手头的驱动精灵 2005专业版就不支持),其它更新版本未知,因为我不想为更高版本激活Key犯愁了:-)
2、兼容驱动精灵已备份的项目,也就是说运行一下脚本就还原所有驱动精灵曾经备份的项目,且路径是任意的,只要在硬盘上或U盘上统统搜出来并更新。
3、支持鼠标点击对话框任选单个设备还原驱动方式。
4、支持宁静默方式外挂安装更新驱动,方便系统集成、Ghost用户调用。
5、修正可能存在的复制错误,更新备份时屏幕显示方式,打印出包含WHQL数字签名的设备名
6、2008-01-17更新重复备份同一设备的问题,更新代码稳定性
@echo off
title 备份基本设备驱动
::::::相关讨论: http://www.cn-dos.net
::::::网上论坛: http://groups.google.com/group/fastslz
::::::个性空间: http://space.cech.com.cn/fastslz
if not %OS%==Windows_NT (cls&echo.&color 4E&echo 此程序必须在Windows NT或2000以上操作系统上运行&ping/n 5 127.1>nul&exit)
devcon.exe>nul 2>nul
if %errorlevel%==9009 (cls&echo.&color 0E&echo 本脚本需要微软 DevCon.exe 命令行实用工具支持&ping/n 5 127.1>nul&exit)
set log="Drivers\%~n0.log"
set Tempfile="%Temp:"=%.\fast.slz"
set count=0&set error=0&set whql=0
if not exist Drivers\nul MD Drivers
del "Drivers\*.log" 2>nul
cls&color 0b
echo.
echo 正在收集设备信息,请稍等...
for %%a in (PCI PCIIDE USB IDE DISPLAY USBPRINT) do (
for /f "tokens=1* delims=: " %%b in ('devcon find *%%a*^|find "\"') do echo "%%b"****"%%c">>"%Temp:"=%.\Devinfo.slz"
)
for /f "tokens=1* delims=****" %%b in ('type "%Temp:"=%.\Devinfo.slz"^|find /v ": "') do call :startcopy "@%%~b" "%%~c"
echo.
echo 已经备份了 %count% 项设备驱动
>>%log% echo.
echo 一共备份了 %count% 项设备驱动>>%log%
if %error% gtr 0 (
echo.
if %error% equ 1 (
echo 在复制过程中遇到错误
) else (
echo 在复制过程中遇到 %error% 个错误
)
echo 请检查日志文件 %log%
)
endlocal
echo.
echo 按任意键退出. . .&pause>nul
:startcopy
color 0e
if "%~2"=="%forestall%" goto:eof
set "forestall=%~2"
setlocal enabledelayedexpansion
if "%~2"=="" goto:eof
del %Tempfile% 2>nul
set ID=%1
devcon driverfiles %1>%Tempfile% 2>nul
find ":\" %Tempfile%>nul
if errorlevel 1 goto:eof
if %count% equ 0 cls
set name="%~2"
>>%log% echo "%~2"
set ename=%name:&=_%
<nul set/p=正在备份--^> %ename:~0,54%
for %%k in (/ ; ,) do set name=!name:%%k=_!
rem set name=%name:(= %
set name=%name:&=_and_%
set name=%name:"=%
for /f "tokens=1 delims=\" %%i in ('type %Tempfile%^|find "\"^|find /v ":"') do set class=%%i
for /f "tokens=1 delims=
上面的备份方法已经够用了,若备份全部的驱动,把
for %%a in (PCI PCIIDE USB IDE DISPLAY) do (
for /f "tokens=1* delims=: " %%b in ('devcon find %%a\*^|find "\"') do call :startcopy "@%%b" "%%c"
)
替换成
for /f "tokens=1* delims=: " %%b in ('devcon findall *^|find "\"') do call :startcopy "@%%b" "%%c"
相关资料:微软DevCon 命令行实用工具可替代设备管理器
还原更新驱动精灵已备份的项目.CMD代码见15楼
Last edited by fastslz on 2008-3-19 at 09:51 AM ]
At the request of members the post about safely deleting USB drives using pure scripts, I accidentally discovered the DevCon command and had an idea to write a script using this command to back up device drivers. This script can back up all device drivers, including hidden devices in Device Manager, and the backup items exceed those of the familiar Driver Genius.
Update Instructions:
I can't say this script is more perfect than Driver Genius, but it does make up for the deficiencies of Driver Genius!
1、Supports backing up complete WHQL digital signatures (the Driver Genius 2005 Professional Edition I have doesn't support this), and I don't know about other updated versions because I don't want to worry about activating keys for higher versions :-)
2、Compatible with items that Driver Genius has already backed up, that is, running the script once will restore all items that Driver Genius has ever backed up, and the path is arbitrary, as long as it is searched out on the hard drive or USB drive and updated.
3、Supports the way of restoring driver by clicking the dialog box to select a single device with the mouse.
4、Supports the silent external installation and update of drivers, which is convenient for system integration and Ghost users to call.
5、Corrects possible copy errors, updates the screen display method when backing up, and prints out the device name containing the WHQL digital signature
6、Updated on 2008-01-17 to solve the problem of repeated backup of the same device and update the code stability
@echo off
title Backup Basic Device Drivers
::::::Related Discussions: http://www.cn-dos.net
::::::Online Forum: http://groups.google.com/group/fastslz
::::::Personal Space: http://space.cech.com.cn/fastslz
if not %OS%==Windows_NT (cls&echo.&color 4E&echo This program must run on Windows NT or above operating system&ping/n 5 127.1>nul&exit)
devcon.exe>nul 2>nul
if %errorlevel%==9009 (cls&echo.&color 0E&echo This script requires the Microsoft DevCon.exe command-line utility&ping/n 5 127.1>nul&exit)
set log="Drivers\%~n0.log"
set Tempfile="%Temp:"=%.\fast.slz"
set count=0&set error=0&set whql=0
if not exist Drivers\nul MD Drivers
del "Drivers\*.log" 2>nul
cls&color 0b
echo.
echo Collecting device information, please wait...
for %%a in (PCI PCIIDE USB IDE DISPLAY USBPRINT) do (
for /f "tokens=1* delims=: " %%b in ('devcon find *%%a*^|find "\"') do echo "%%b"****"%%c">>"%Temp:"=%.\Devinfo.slz"
)
for /f "tokens=1* delims=****" %%b in ('type "%Temp:"=%.\Devinfo.slz"^|find /v ": "') do call :startcopy "@%%~b" "%%~c"
echo.
echo Have backed up %count% items of device drivers
>>%log% echo.
echo A total of %count% items of device drivers have been backed up>>%log%
if %error% gtr 0 (
echo.
if %error% equ 1 (
echo Encountered an error during copying
) else (
echo Encountered %error% errors during copying
)
echo Please check the log file %log%
)
endlocal
echo.
echo Press any key to exit. . .&pause>nul
:startcopy
color 0e
if "%~2"=="%forestall%" goto:eof
set "forestall=%~2"
setlocal enabledelayedexpansion
if "%~2"=="" goto:eof
del %Tempfile% 2>nul
set ID=%1
devcon driverfiles %1>%Tempfile% 2>nul
find ":\" %Tempfile%>nul
if errorlevel 1 goto:eof
if %count% equ 0 cls
set name="%~2"
>>%log% echo "%~2"
set ename=%name:&=_%
<nul set/p=Backing up--^> %ename:~0,54%
for %%k in (/ ; ,) do set name=!name:%%k=_!
rem set name=%name:(= %
set name=%name:&=_and_%
set name=%name:"=%
for /f "tokens=1 delims=\" %%i in ('type %Tempfile%^|find "\"^|find /v ":"') do set class=%%i
for /f "tokens=1 delims=
The above backup method is sufficient. If you want to back up all drivers, replace
for %%a in (PCI PCIIDE USB IDE DISPLAY) do (
for /f "tokens=1* delims=: " %%b in ('devcon find %%a\*^|find "\"') do call :startcopy "@%%b" "%%c"
)
with
for /f "tokens=1* delims=: " %%b in ('devcon findall *^|find "\"') do call :startcopy "@%%b" "%%c"
Related Information: Microsoft DevCon Command-Line Utility Can Replace Device Manager
The CMD code for restoring and updating items backed up by Driver Genius is in post 15
Last edited by fastslz on 2008-3-19 at 09:51 AM ]
此帖被 +42 点积分 点击查看详情 评分人:【 abcd 】 | 分数: +4 | 时间:2007-11-6 14:21 | 评分人:【 lxmxn 】 | 分数: +8 | 时间:2007-11-6 14:28 | 评分人:【 baomaboy 】 | 分数: +7 | 时间:2007-11-6 20:39 | 评分人:【 everest79 】 | 分数: +15 | 时间:2007-11-7 00:25 | 评分人:【 vkill 】 | 分数: +4 | 时间:2007-11-7 22:04 | 评分人:【 wangjf 】 | 分数: +4 | 时间:2008-2-14 16:29 |
|
附件
1: 备份驱动.rar (2008-1-17 22:23, 91.35 KiB, 下载附件所需积分 1 点
,下载次数: 312)
|

第一高手 第二高手
我的小站
 |
|
2007-11-6 13:30 |
|
|
hello547rf44
初级用户
 
积分 172
发帖 63
注册 2007-11-3
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
COOL,刚刚从vkill师父那里知道有这个好东西,就马上用上了。测试结果如下:
正在备份驱动 ---> "Intel(R) 82845 Processor to I/O Controller - 1A30"
正在备份驱动 ---> "Intel(R) 82845 Processor to AGP Controller - 1A31"
正在备份驱动 ---> "Intel(R) 82801BA LPC Interface Controller - 2440"
正在备份驱动 ---> "Intel(R) 82801BA/BAM USB Universal Host Controller - 2442"
正在备份驱动 ---> "Intel(R) 82801BA/BAM SMBus Controller - 2443"
正在备份驱动 ---> "Intel(R) 82801BA/BAM USB Universal Host Controller - 2444"
正在备份驱动 ---> "Intel(r) 82801BA/BAM AC'97 Audio Controller"
正在备份驱动 ---> "Intel(R) 82801BA Ultra ATA Storage Controller - 244B"
正在备份驱动 ---> "Intel(R) 82801 PCI Bridge - 244E"
正在备份驱动 ---> "USB Root Hub"
正在备份驱动 ---> "USB Root Hub"
正在备份驱动 ---> "Unknown Device"
正在备份驱动 ---> "USB USB\VID_8086&PID_1122\5&16DC22A8&0&2
: Generic USB Hub"
正在备份驱动 ---> "WDC WD400BB-00JHC0"
已经备份了 17 个设备驱动
在复制过程中遇到错误
请检查日志文件 "Drivers\1.log"
请按任意键继续. . .
好像有一点重复备份了。
COOL, just found out about this great thing from Master vkill and immediately used it. The test results are as follows:
Backing up driver ---> "Intel(R) 82845 Processor to I/O Controller - 1A30"
Backing up driver ---> "Intel(R) 82845 Processor to AGP Controller - 1A31"
Backing up driver ---> "Intel(R) 82801BA LPC Interface Controller - 2440"
Backing up driver ---> "Intel(R) 82801BA/BAM USB Universal Host Controller - 2442"
Backing up driver ---> "Intel(R) 82801BA/BAM SMBus Controller - 2443"
Backing up driver ---> "Intel(R) 82801BA/BAM USB Universal Host Controller - 2444"
Backing up driver ---> "Intel(r) 82801BA/BAM AC'97 Audio Controller"
Backing up driver ---> "Intel(R) 82801BA Ultra ATA Storage Controller - 244B"
Backing up driver ---> "Intel(R) 82801 PCI Bridge - 244E"
Backing up driver ---> "USB Root Hub"
Backing up driver ---> "USB Root Hub"
Backing up driver ---> "Unknown Device"
Backing up driver ---> "USB USB\VID_8086&PID_1122\5&16DC22A8&0&2
: Generic USB Hub"
Backing up driver ---> "WDC WD400BB-00JHC0"
17 device drivers have been backed up
An error occurred during the copying process
Please check the log file "Drivers\1.log"
Press any key to continue...
It seems there is a bit of duplicate backup.
|
|
2007-11-6 20:24 |
|
|
hello547rf44
初级用户
 
积分 172
发帖 63
注册 2007-11-3
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
期待还原驱动的作品!
Looking forward to the work of restoring the driver!
附件
1: 1.gif (2007-11-6 20:27, 5.23 KiB,下载次数: 1)
|
|
2007-11-6 20:27 |
|
|
fastslz
铂金会员
       DOS一根葱
积分 5493
发帖 2315
注册 2006-5-1 来自 上海
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
还原驱动不好搞定啊,想了几个方案,搞的现在满脑子符号,弄的完全没有头绪了。devcon install参数不适合已知硬件,devcon update必须要先获得硬件ID,硬件ID有一定规律但不好筛选,还要筛选些不必更新的。
Restoring drivers is not easy to handle. I've thought of several solutions, but now my mind is full of symbols, and I'm completely at a loss. The devcon install parameter isn't suitable for the known hardware, and devcon update must first obtain the hardware ID. The hardware ID has a certain pattern but is not easy to screen, and we also need to screen out those that don't need to be updated.
|

第一高手 第二高手
我的小站
 |
|
2007-11-7 13:26 |
|
|
fastslz
铂金会员
       DOS一根葱
积分 5493
发帖 2315
注册 2006-5-1 来自 上海
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
这楼我就贴点Devcon相关参数及其它应用
常用类型:PCI PCIIDE USB USBSTOR IDE PCIIDE DISPLAY
Devcon hwids * 获取全部的硬件ID
Devcon hwids 常用类型\* 获取常用类型硬件ID
Devcon find 常用类型\* 查找常用类型硬件信息
Devcon find gendisk 只查找硬盘包括移动硬盘信息
Devcon find gencdrom 只查找光驱信息
Devcon update xxx.inf 硬件ID 更新驱动
查询:全球所有 PCI,AGP,PCI-X,PCIe 硬件ID及名称该站不断更新信息(如果你是OEM设备那就查查吧)
@echo off
setlocal enabledelayedexpansion
echo 硬盘型号 接口类型 修订版本
echo ======== ======== ========
for /f "tokens=1,2* delims=\" %%a in ('devcon.exe find gendisk^|find /v /i "USBSTOR\"^|find ":"') do call :fastslz "%%a" "%%b" "%%c"
echo.&pause
:fastslz
set "填充空格= "
set 类型=%~1%填充空格%
set 修订=%~2
set 修订=%修订:_= %
for %%i in (%修订%) do set 修订=%%i
for /f "tokens=1* delims=:" %%a in ('echo %3') do set 型号="%%~b"
set 型号=%型号:~0,30%
set 型号=%型号:"=%%填充空格%
set 型号=%型号:~1,30%
echo %型号%%类型:~0,12%%修订%
goto:eof
Last edited by fastslz on 2007-11-7 at 06:09 PM ]
This floor I'll just post some Devcon related parameters and other applications
Common types: PCI PCIIDE USB USBSTOR IDE PCIIDE DISPLAY
Devcon hwids * Get all hardware IDs
Devcon hwids Common types\* Get common type hardware IDs
Devcon find Common types\* Find common type hardware information
Devcon find gendisk Only find hard disk including mobile hard disk information
Devcon find gencdrom Only find CD-ROM information
Devcon update xxx.inf Hardware ID Update driver
Query: All PCI, AGP, PCI-X, PCIe hardware IDs and names in the world This site continuously updates information (if you are an OEM device then check it out)
@echo off
setlocal enabledelayedexpansion
echo Hard disk model Interface type Revision version
echo ======== ======== ========
for /f "tokens=1,2* delims=\" %%a in ('devcon.exe find gendisk^|find /v /i "USBSTOR\"^|find ":"') do call :fastslz "%%a" "%%b" "%%c"
echo.&pause
:fastslz
set "Fill space= "
set type=%~1%Fill space%
set revision=%~2
set revision=%revision:_= %
for %%i in (%revision%) do set revision=%%i
for /f "tokens=1* delims=:" %%a in ('echo %3') do set model="%%~b"
set model=%model:~0,30%
set model=%model:"=%%Fill space%
set model=%model:~1,30%
echo %model%%type:~0,12%%revision%
goto:eof
Last edited by fastslz on 2007-11-7 at 06:09 PM ]
|

第一高手 第二高手
我的小站
 |
|
2007-11-7 13:52 |
|
|
vkill
金牌会员
     
积分 4103
发帖 1744
注册 2006-1-20 来自 甘肃.临泽
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
devcon hwids * 后察看就有下面这段
PCI\VEN_1002&DEV_4153&SUBSYS_41531FD3&REV_00\4&1AD7642&0&0058
Name: RADEON 9550
Hardware ID's:
PCI\VEN_1002&DEV_4153&SUBSYS_41531FD3&REV_00
PCI\VEN_1002&DEV_4153&SUBSYS_41531FD3
PCI\VEN_1002&DEV_4153&CC_030000
PCI\VEN_1002&DEV_4153&CC_0300
Compatible ID's:
PCI\VEN_1002&DEV_4153&REV_00
PCI\VEN_1002&DEV_4153
PCI\VEN_1002&CC_030000
PCI\VEN_1002&CC_0300
PCI\VEN_1002
PCI\CC_030000
PCI\CC_0300
正在备份驱动 ---> "RADEON 9550 "
请按任意键继续. . .
现在察看刚备份的文件夹下就有个inf文件
C:\>cd "C:\Downloads\Drivers\PCI\RADEON 9550\"
C:\Downloads\Drivers\PCI\RADEON 9550>devcon update oem4.inf "PCI\VEN_1002&DEV_41
53&SUBSYS_41531FD3&REV_00"
Updating drivers for PCI\VEN_1002&DEV_4153&SUBSYS_41531FD3&REV_00 from C:\Downlo
ads\Drivers\PCI\RADEON 9550\oem4.inf.
Drivers updated successfully.
我想依次
Hardware ID's:
PCI\VEN_1002&DEV_4153&SUBSYS_41531FD3&REV_00
PCI\VEN_1002&DEV_4153&SUBSYS_41531FD3
PCI\VEN_1002&DEV_4153&CC_030000
PCI\VEN_1002&DEV_4153&CC_0300
把这四个都更新应该没有什么问题
谁测试下好了
Last edited by vkill on 2007-11-7 at 09:58 PM ]
After running devcon hwids *, the following section is observed:
PCI\VEN_1002&DEV_4153&SUBSYS_41531FD3&REV_00\4&1AD7642&0&0058
Name: RADEON 9550
Hardware ID's:
PCI\VEN_1002&DEV_4153&SUBSYS_41531FD3&REV_00
PCI\VEN_1002&DEV_4153&SUBSYS_41531FD3
PCI\VEN_1002&DEV_4153&CC_030000
PCI\VEN_1002&DEV_4153&CC_0300
Compatible ID's:
PCI\VEN_1002&DEV_4153&REV_00
PCI\VEN_1002&DEV_4153
PCI\VEN_1002&CC_030000
PCI\VEN_1002&CC_0300
PCI\VEN_1002
PCI\CC_030000
PCI\CC_0300
Backing up the driver ---> "RADEON 9550 "
Press any key to continue. . .
Now, looking at the just-backed-up folder, there is an inf file.
C:\>cd "C:\Downloads\Drivers\PCI\RADEON 9550\"
C:\Downloads\Drivers\PCI\RADEON 9550>devcon update oem4.inf "PCI\VEN_1002&DEV_41
53&SUBSYS_41531FD3&REV_00"
Updating drivers for PCI\VEN_1002&DEV_4153&SUBSYS_41531FD3&REV_00 from C:\Downlo
ads\Drivers\PCI\RADEON 9550\oem4.inf.
Drivers updated successfully.
I think it should be no problem to update all four of the following:
Hardware ID's:
PCI\VEN_1002&DEV_4153&SUBSYS_41531FD3&REV_00
PCI\VEN_1002&DEV_4153&SUBSYS_41531FD3
PCI\VEN_1002&DEV_4153&CC_030000
PCI\VEN_1002&DEV_4153&CC_0300
Whoever tests it is fine.
Last edited by vkill on 2007-11-7 at 09:58 PM ]
|
|
2007-11-7 21:49 |
|
|
vkill
金牌会员
     
积分 4103
发帖 1744
注册 2006-1-20 来自 甘肃.临泽
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
C:\>cd C:\Downloads\Drivers\USB\USB Root Hub
C:\Downloads\Drivers\USB\USB Root Hub>devcon update "C:\Downloads\Drivers\USB\US
B Root Hub\usbport.inf" "USB\ROOT_HUB&VID10DE&PID00E7&REV00A1"
Updating drivers for USB\ROOT_HUB&VID10DE&PID00E7&REV00A1 from C:\Downloads\Driv
ers\USB\USB Root Hub\usbport.inf.
Drivers updated successfully.
C:\Downloads\Drivers\USB\USB Root Hub>devcon update "C:\Downloads\Drivers\USB\US
B Root Hub\usbport.inf" "USB\ROOT_HUB&VID10DE&PID00E7"
Updating drivers for USB\ROOT_HUB&VID10DE&PID00E7 from C:\Downloads\Drivers\USB\
USB Root Hub\usbport.inf.
Drivers updated successfully.
C:\Downloads\Drivers\USB\USB Root Hub>devcon update "C:\Downloads\Drivers\USB\US
B Root Hub\usbport.inf" "USB\ROOT_HUB"
Updating drivers for USB\ROOT_HUB from C:\Downloads\Drivers\USB\USB Root Hub\usb
port.inf.
Drivers updated successfully.
像这个更新 USB Root Hub 的就没有问题,一切正常
C:\>cd C:\Downloads\Drivers\USB\USB Root Hub
C:\Downloads\Drivers\USB\USB Root Hub>devcon update "C:\Downloads\Drivers\USB\US
B Root Hub\usbport.inf" "USB\ROOT_HUB&VID10DE&PID00E7&REV00A1"
Updating drivers for USB\ROOT_HUB&VID10DE&PID00E7&REV00A1 from C:\Downloads\Driv
ers\USB\USB Root Hub\usbport.inf.
Drivers updated successfully.
C:\Downloads\Drivers\USB\USB Root Hub>devcon update "C:\Downloads\Drivers\USB\US
B Root Hub\usbport.inf" "USB\ROOT_HUB&VID10DE&PID00E7"
Updating drivers for USB\ROOT_HUB&VID10DE&PID00E7 from C:\Downloads\Drivers\USB\
USB Root Hub\usbport.inf.
Drivers updated successfully.
C:\Downloads\Drivers\USB\USB Root Hub>devcon update "C:\Downloads\Drivers\USB\US
B Root Hub\usbport.inf" "USB\ROOT_HUB"
Updating drivers for USB\ROOT_HUB from C:\Downloads\Drivers\USB\USB Root Hub\usb
port.inf.
Drivers updated successfully.
Like this update of the USB Root Hub has no problems, everything is normal
|
|
2007-11-7 22:09 |
|
|
fastslz
铂金会员
       DOS一根葱
积分 5493
发帖 2315
注册 2006-5-1 来自 上海
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
PCI\VEN_1002&DEV_4153&SUBSYS_41531FD3&REV_00
PCI\VEN_1002&DEV_4153&SUBSYS_41531FD3
PCI\VEN_1002&DEV_4153&CC_030000
PCI\VEN_1002&DEV_4153&CC_0300
Compatible ID's:
PCI\VEN_1002&DEV_4153&REV_00
PCI\VEN_1002&DEV_4153
PCI\VEN_1002&CC_030000
PCI\VEN_1002&CC_0300
PCI\VEN_1002
PCI\CC_030000
PCI\CC_0300
恩上面的都是硬件ID,有的少有的多,devcon update oem4.inf 上面10个都能成功更新,最通用是PCI\VEN_1002,也就是筛选出符号&第1次出现的前几位就行了,这个筛选是最通用的。但是在USB设备上有时就不通用如
"@USB\ROOT_HUB\4&1D255E7A&0"
"@USB\ROOT_HUB\4&84E02D0&0"
"@USB\ROOT_HUB\4&A6BADD5&0"
备份的时候已经生成了硬件ID保存在HardwareID.log
```
PCI\VEN_1002&DEV_4153&SUBSYS_41531FD3&REV_00
PCI\VEN_1002&DEV_4153&SUBSYS_41531FD3
PCI\VEN_1002&DEV_4153&CC_030000
PCI\VEN_1002&DEV_4153&CC_0300
Compatible ID's:
PCI\VEN_1002&DEV_4153&REV_00
PCI\VEN_1002&DEV_4153
PCI\VEN_1002&CC_030000
PCI\VEN_1002&CC_0300
PCI\VEN_1002
PCI\CC_030000
PCI\CC_0300
```
The above are all hardware IDs, some are fewer and some are more. devcon update oem4.inf can successfully update all 10 above. The most common one is PCI\VEN_1002, that is, filter out the first few digits before the first occurrence of &. This filtering is the most common. But sometimes it is not common on USB devices such as
"@USB\ROOT_HUB\4&1D255E7A&0"
"@USB\ROOT_HUB\4&84E02D0&0"
"@USB\ROOT_HUB\4&A6BADD5&0"
The hardware IDs have been generated during backup and saved in HardwareID.log
|

第一高手 第二高手
我的小站
 |
|
2007-11-7 23:00 |
|
|
fastslz
铂金会员
       DOS一根葱
积分 5493
发帖 2315
注册 2006-5-1 来自 上海
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
还原驱动已经写好了1楼打包下载,需要sed.exe,有问题跟贴
另外有SATA,SATAII,SCSI,IEEE1394设备的朋友麻烦告知下这些设备是否在常用类型里,谢谢
Last edited by fastslz on 2007-11-8 at 05:10 PM ]
The restore driver has been written. It's packed and downloadable on the first floor. sed.exe is needed. If you have any questions, post a reply.
Also, friends who have SATA, SATAII, SCSI, IEEE1394 devices, please let us know whether these devices are in the common types. Thanks
Last edited by fastslz on 2007-11-8 at 05:10 PM ]
|

第一高手 第二高手
我的小站
 |
|
2007-11-8 13:04 |
|
|
hello547rf44
初级用户
 
积分 172
发帖 63
注册 2007-11-3
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
NVIDIA GeForce4 MX 440 (Microsoft Corporation)
D-Link DFE-530TX PCI Fast Ethernet Adapter (rev.C) #3
D-Link DFE-530TX PCI Fast Ethernet Adapter (rev.C) #2
Intel(R) 82845 Processor to I/O Controller - 1A30
Intel(R) 82845 Processor to AGP Controller - 1A31
Intel(R) 82801BA LPC Interface Controller - 2440
Intel(R) 82801BA/BAM USB Universal Host Controller - 2442
Intel(R) 82801BA/BAM SMBus Controller - 2443
Intel(R) 82801BA/BAM USB Universal Host Controller - 2444
Intel(r) 82801BA/BAM AC'97 Audio Controller
Intel(R) 82801BA Ultra ATA Storage Controller - 244B
Intel(R) 82801 PCI Bridge - 244E
USB Root Hub
USB Root Hub
Unknown Device
USB USB\VID_8086&PID_1122\5&16DC22A8&0&2 : Generi
SB Hub
找不到文件 - input.inf
WDC WD400BB-00JHC0
请选择要更新的设备名,模糊输入连续5个以上字节↘
不会用
NVIDIA GeForce4 MX 440 (Microsoft Corporation)
D-Link DFE-530TX PCI Fast Ethernet Adapter (rev.C) #3
D-Link DFE-530TX PCI Fast Ethernet Adapter (rev.C) #2
Intel(R) 82845 Processor to I/O Controller - 1A30
Intel(R) 82845 Processor to AGP Controller - 1A31
Intel(R) 82801BA LPC Interface Controller - 2440
Intel(R) 82801BA/BAM USB Universal Host Controller - 2442
Intel(R) 82801BA/BAM SMBus Controller - 2443
Intel(R) 82801BA/BAM USB Universal Host Controller - 2444
Intel(r) 82801BA/BAM AC'97 Audio Controller
Intel(R) 82801BA Ultra ATA Storage Controller - 244B
Intel(R) 82801 PCI Bridge - 244E
USB Root Hub
USB Root Hub
Unknown Device
USB USB\VID_8086&PID_1122\5&16DC22A8&0&2 : Generi
SB Hub
File not found - input.inf
WDC WD400BB-00JHC0
Please select the device name to update, input continuously more than 5 bytes vaguely ↘
Don't know how to use
|
|
2007-11-8 13:56 |
|
|
fastslz
铂金会员
       DOS一根葱
积分 5493
发帖 2315
注册 2006-5-1 来自 上海
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
我也刚发现,全部备份的就会出现这个情况,汗啊,待修正....
模糊输入即NVIDIA GeForce4 MX 440 (Microsoft Corporation)只要输入NVIDIA
Last edited by fastslz on 2007-11-8 at 02:04 PM ]
I just found out too. This situation will occur with full backups. Oh, need to fix....
Fuzzy input means NVIDIA GeForce4 MX 440 (Microsoft Corporation), just input NVIDIA
Last edited by fastslz on 2007-11-8 at 02:04 PM ]
|

第一高手 第二高手
我的小站
 |
|
2007-11-8 14:03 |
|
|
hello547rf44
初级用户
 
积分 172
发帖 63
注册 2007-11-3
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
不错,不错。建意另外加个auto参数。能以静默方式还原Drives目录下的所有驱动。(即使个别错误也不提示)如果这个也能实现的话,再建意“备份驱动.bat”和“还愿驱动”加上个压缩包功能。把所有的驱动打包为mydirves.zip类似的一个文件。还原的话就先将它解开。哇,这样的话,不用过多久,那此GHOST系统之类的装机光盘又有的更新了。哈哈。
这么好的贴子为什么不加精呢?
Not bad, not bad. It is suggested to add an auto parameter additionally. It can restore all drivers in the Drives directory in silent mode. (Even if there are individual errors, no prompt will be given) If this can also be realized, it is suggested to add a compression package function to "Backup Drivers.bat" and "Restore Drivers". Package all drivers into a file like mydrives.zip. For restoration, just unzip it first. Wow, in this way, it won't be long before those GHOST system - like installation discs for installing systems will have new updates. Haha. Why isn't such a good post highlighted?
|
|
2007-11-8 14:25 |
|
|
sh2288
新手上路

积分 4
发帖 2
注册 2007-10-30
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
高手啊!!我只用这个工具切换网卡!!
一个网卡是boardcom,一个是8139的.因为一个是内部一个是外部所以手动麻烦啊!!
devcon disable *DEV_1677* >nul
devcon enable *DEV_8139* >nul
Expert! I only use this tool to switch network cards! One network card is boardcom, and the other is 8139. Because one is internal and the other is external, so it's troublesome to do it manually!!
devcon disable *DEV_1677* >nul
devcon enable *DEV_8139* >nul
|
|
2007-11-8 15:39 |
|
|
fastslz
铂金会员
       DOS一根葱
积分 5493
发帖 2315
注册 2006-5-1 来自 上海
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
Originally posted by hello547rf44 at 2007-11-8 14:25:
不错,不错。建意另外加个auto参数。能以静默方式还原Drives目录下的所有驱动。(即使个别错误也不提示)如果这个也能实现的话,再建意“备份驱动 ...
还原还要驱动优化,这个就当是临时还原脚本吧。压缩是最简单的直接调用
start winrar.exe u -ep1 -m5 -r .\MyDrivers.rar .\*
至于ghost系统吧我是不感冒,但是驱动和硬件ID收集够多完全能做到,我倒喜欢系统安装时外挂脚本安装驱动
Originally posted by sh2288 at 2007-11-8 15:39:
高手啊!!我只用这个工具切换网卡!!
一个网卡是boardcom,一个是8139的.因为一个是内部一个是外部所以手动麻烦啊!!
devcon disable *DEV_1677* >nul
devcon enable *DEV_8139* >nul
确实是个好办法,象你这样的情况很普遍,呵呵现在有新招了。。。。
Originally posted by hello547rf44 at 2007-11-8 14:25:
Not bad, not bad. Suggest adding an additional auto parameter. It can restore all drivers in the Drives directory in silent mode. (Even if there are individual errors, no prompts are given) If this can also be achieved, then suggest "Backup drivers...
Restoring also requires driver optimization, this is just a temporary restore script. Compression is the simplest, directly call
start winrar.exe u -ep1 -m5 -r .\MyDrivers.rar .\*
As for ghost system, I'm not keen on it, but if the drivers and hardware IDs are collected enough, it can be completely done. I prefer to install drivers with external scripts when installing the system
Originally posted by sh2288 at 2007-11-8 15:39:
Expert!! I only use this tool to switch network cards!!
One network card is boardcom, and the other is 8139. Because one is internal and the other is external, so it's troublesome to do manually!!
devcon disable *DEV_1677* >nul
devcon enable *DEV_8139* >nul
Indeed, it's a good method. Situations like yours are very common, hehe, now there are new tricks...
|

第一高手 第二高手
我的小站
 |
|
2007-11-8 17:56 |
|
|
fastslz
铂金会员
       DOS一根葱
积分 5493
发帖 2315
注册 2006-5-1 来自 上海
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
@echo OFF
title 还原更新(驱动精灵)备份项目
::::::相关讨论: http://www.cn-dos.net
::::::网上论坛: http://groups.google.com/group/fastslz
::::::个性空间: http://space.cech.com.cn/fastslz
if not %OS%==Windows_NT (cls&echo.&color 4E&echo 此程序必须在Windows NT或2000以上操作系统上运行&ping/n 5 127.1>nul&EXIT)
devcon.exe>nul 2>nul
if %errorlevel%==9009 (cls&echo.&color 0E&echo 本脚本需要微软 DevCon.exe 命令行实用工具支持&ping/n 5 127.1>nul&EXIT)
set log="Drivers\%~n0.log"
set Tempfile="%Temp:"=%.\fast.slz"
set count=0
del "Drivers\*.log" 2>nul
del %Tempfile% 2>nul
cls&color 0b
echo.
echo 正在全盘搜索(驱动精灵)备份项目信息,这个可能持续较长时间,请稍等...
setlocal enabledelayedexpansion
for /f "delims=\" %%i in ('fsutil fsinfo drives^|find /v "a"') do (
set var=%%i
set drive=!var:~-2!
fsutil fsinfo drivetype !drive!\|find /v "-ROM">nul &dir /s /b /a-d !drive!\Driver.nfo>>%Tempfile% 2>nul
)
for /f "delims=*" %%i in ('type %Tempfile%^|find /i /v "RECYCLE"') do type "%%i"|find /i "InfFile">nul 2>nul
if %errorlevel%==1 cls&echo.&color 0e&echo 在所有本地磁盘、及移动磁盘上未发现(驱动精灵)备份项目信息&echo 如果驱动文件已压缩请解压文件到任意位置,再运行本脚本&ping/n 10 127.1>nul&exit/b
:::::goto Driver_start
Wprompt "提示信息" "按下确定开始还原驱动精灵已备份的项目,需要单个恢复模式脚本请联系本人 " OkCancel 2 ?
if %errorlevel%==2 color 0e&echo 用户取消操作 . . .&ping/n 3 127.1>nul&exit/b
:Driver_start
cls
for /f "delims=*" %%i in ('type %Tempfile%^|find /i /v "RECYCLE"') do (
for /f "tokens=1* delims==" %%a in ('type "%%~i"^|find /i "DriverName"') do (
for /f "tokens=1* delims==" %%e in ('type "%%~i"^|find /i "InfFile"') do (
for /f "tokens=1* delims==&" %%k in ('type "%%~i"^|find /i "HardwareID"') do (call :startdriver "%%b" "%%~dpi%%f" "%%l")
)
)
)
del %Tempfile% 2>nul
echo.
echo 一共更新了 %count% 项设备驱动
echo.
echo 按任意键退出. . .&pause>nul
:startdriver
set "ID=%~3"
set "typename=%~1"
if not defined typename goto:eof
set/p=正在更新--^> "%typename:~0,47%"<nul
if not exist "%~2" echo 没有对应项,执行下一项目 . . .&ping/n 2 127.1>nul&goto:eof
rem 如果不能成功更新,尝试下一for语句delims=上加符号&
for /f "delims=" %%m in ('echo."%ID%"') do devcon updateNI "%~2" "%%~m">nul
if %errorlevel%==0 color 0e&echo ^<--设备驱动已更新&ping/n 1 127.1>nul&color 0b
if %errorlevel%==1 color 0e&echo ^<--已更新提示重启&ping/n 1 127.1>nul&color 0b
if %errorlevel%==2 color 0e&echo ^<--提示更新失败!&echo 原因未正确判断出硬件ID,或驱动源不正确。&ping/n 1 127.1>nul
if %errorlevel%==3 color 0e&echo DevCon语法错误。&ping/n 1 127.1>nul
set /a "count=%count%+1"
del %Tempfile% 2>nul
endlocal&(set count=%count%)
goto:eof
Last edited by fastslz on 2008-1-17 at 10:26 PM ]
```code
@echo OFF
title Restore Update (Driver Genius) Backup Items
::::::Related Discussion: http://www.cn-dos.net
::::::Online Forum: http://groups.google.com/group/fastslz
::::::Personal Space: http://space.cech.com.cn/fastslz
if not %OS%==Windows_NT (cls&echo.&color 4E&echo This program must run on Windows NT or above 2000 operating system&ping/n 5 127.1>nul&EXIT)
devcon.exe>nul 2>nul
if %errorlevel%==9009 (cls&echo.&color 0E&echo This script requires the support of Microsoft DevCon.exe command-line utility&ping/n 5 127.1>nul&EXIT)
set log="Drivers\%~n0.log"
set Tempfile="%Temp:"=%.\fast.slz"
set count=0
del "Drivers\*.log" 2>nul
del %Tempfile% 2>nul
cls&color 0b
echo.
echo Searching for (Driver Genius) backup item information throughout the disk, this may take a long time, please wait...
setlocal enabledelayedexpansion
for /f "delims=\" %%i in ('fsutil fsinfo drives^|find /v "a"') do (
set var=%%i
set drive=!var:~-2!
fsutil fsinfo drivetype !drive!\|find /v "-ROM">nul &dir /s /b /a-d !drive!\Driver.nfo>>%Tempfile% 2>nul
)
for /f "delims=*" %%i in ('type %Tempfile%^|find /i /v "RECYCLE"') do type "%%i"|find /i "InfFile">nul 2>nul
if %errorlevel%==1 cls&echo.&color 0e&echo No (Driver Genius) backup item information found on all local disks and removable disks&echo If the driver file is compressed, please extract the file to any location, then run this script&ping/n 10 127.1>nul&exit/b
:::::goto Driver_start
Wprompt "Prompt Information" "Press OK to start restoring the items backed up by Driver Genius, please contact me for the single recovery mode script " OkCancel 2 ?
if %errorlevel%==2 color 0e&echo User canceled the operation . . .&ping/n 3 127.1>nul&exit/b
:Driver_start
cls
for /f "delims=*" %%i in ('type %Tempfile%^|find /i /v "RECYCLE"') do (
for /f "tokens=1* delims==" %%a in ('type "%%~i"^|find /i "DriverName"') do (
for /f "tokens=1* delims==" %%e in ('type "%%~i"^|find /i "InfFile"') do (
for /f "tokens=1* delims==&" %%k in ('type "%%~i"^|find /i "HardwareID"') do (call :startdriver "%%b" "%%~dpi%%f" "%%l")
)
)
)
del %Tempfile% 2>nul
echo.
echo A total of %count% device drivers were updated
echo.
echo Press any key to exit. . .&pause>nul
:startdriver
set "ID=%~3"
set "typename=%~1"
if not defined typename goto:eof
set/p=Updating--^> "%typename:~0,47%"<nul
if not exist "%~2" echo No corresponding item, execute the next item . . .&ping/n 2 127.1>nul&goto:eof
rem If the update cannot be successful, try adding symbols to the next for statement delims=&
for /f "delims=" %%m in ('echo."%ID%"') do devcon updateNI "%~2" "%%~m">nul
if %errorlevel%==0 color 0e&echo ^<--Device driver has been updated&ping/n 1 127.1>nul&color 0b
if %errorlevel%==1 color 0e&echo ^<--Update prompt to restart&ping/n 1 127.1>nul&color 0b
if %errorlevel%==2 color 0e&echo ^<--Update failed!&echo The reason is that the hardware ID is not correctly judged, or the driver source is incorrect.&ping/n 1 127.1>nul
if %errorlevel%==3 color 0e&echo DevCon syntax error.&ping/n 1 127.1>nul
set /a "count=%count%+1"
del %Tempfile% 2>nul
endlocal&(set count=%count%)
goto:eof
Last edited by fastslz on 2008-1-17 at 10:26 PM ]
```
|

第一高手 第二高手
我的小站
 |
|
2007-11-13 14:07 |
|