|  | 
 
| fastslz 铂金会员
 
        DOS一根葱
 
 
 积分 5493
 发帖 2315
 注册 2006-5-1
 来自 上海
 状态 离线
 | 
| 『第 31 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
关于重复备份能处理掉,但这样做效率低处理时间长,虽然是重复但备份的驱动文件很少出现重复的情况。 
WHQL数字签名呢我是读取oem*.inf提取相应的.cat来弥补devcon的不足,而且最后把oem*.inf和oem*.cat改名成inf内容里相同的文件名,这样才能保证再次更新时WHQL数字签名是有效的,而驱动精灵只提取了cat文件没有把.inf改名成对应的文件名造成再次更新时WHQL数字签名是无效的,也就是驱动精灵最大的不足。 
比如我的创新声卡inf内容是
 ; ECTIVA Audio 5.1 Series INF file;
 ; Feature  : Enhanced (WDM)
 ; Language : English
 ;
 ; Date     : 12 Feb 2004
 ; Revision : 1.00.003
 ;
 ; Copyright 1995-2004, Creative Technology Ltd.
 
 
 Signature="$CHICAGO$"
 Class=MEDIA
 ClassGUID={4d36e96c-e325-11ce-bfc1-08002be10318}
 provider=%MfgName%
 CatalogFile=ECTIVA.cat
 DriverVer=02/12/2004,5.12.01.004
 
 
 %MfgName%=ECTIVA
 
驱动安装后文件是以oem2.inf和oem2.cat保存在系统目录,备份好不改名成ECTIVA.inf和ECTIVA.cat,再次更新驱动时WHQL数字签名是无效的,驱动精灵只能做到oem2.inf和ECTIVA.cat
 
改名代码 
for /f "tokens=1* delims== " %%k in ('type "%inf%"^|find /i ".cat"') do set oemname=%%~nl 
if defined oemname for /f "delims=*" %%k in ('dir /s /b /a-d "%SystemRoot%\system32\CatRoot\%infname%.cat" 2^>nul') do set catfile=%%~k 
if not defined catfile for /f "delims=*" %%k in ('dir /s /b /a-d "%SystemRoot%\%oemname%.cat" 2^>nul') do set catfile=%%k 
if defined catfile ( 
           set infname=%oemname% 
           xcopy /h /r /y "%catfile%" "drivers\%class%\%name%\*.*">nul 2>>%log% 
           if errorlevel 0 color 0e&&echo  含WHQL数字签名 
           attrib -s -h -r "drivers\%class%\%name%\%infname%.*">nul 
           move /y "drivers\%class%\%name%\%infname%.inf" "drivers\%class%\%name%\%oemname%.inf">nul 2>nul 
           move /y "drivers\%class%\%name%\%infname%.cat" "drivers\%class%\%name%\%oemname%.cat">nul 2>nul 
) 
for /f "delims= " %%i in ('devcon hwids %ID%^|sed -n "/Hardware ID's:/{n;p;}"') do echo "%infname%.inf"****"%%~i">>"drivers\HardwareID.log"
Regarding repeated backups, they can be handled, but this is inefficient and takes a long time. Although there are repeats, the driver files being backed up rarely have duplicates. 
For WHQL digital signatures, I read the oem*.inf to extract the corresponding.cat to compensate for the shortcomings of devcon. And finally, rename oem*.inf and oem*.cat to the same file name as in the inf content, so that the WHQL digital signature remains valid when updating again. The major shortcoming of Driver Genius is that it only extracts the.cat file and does not rename the.inf to the corresponding file name, resulting in an invalid WHQL digital signature when updating again.
 
For example, the content of my Creative sound card inf is
 ; ECTIVA Audio 5.1 Series INF file;
 ; Feature  : Enhanced (WDM)
 ; Language : English
 ;
 ; Date     : 12 Feb 2004
 ; Revision : 1.00.003
 ;
 ; Copyright 1995-2004, Creative Technology Ltd.
 
 
 Signature="$CHICAGO$"
 Class=MEDIA
 ClassGUID={4d36e96c-e325-11ce-bfc1-08002be10318}
 provider=%MfgName%
 CatalogFile=ECTIVA.cat
 DriverVer=02/12/2004,5.12.01.004
 
 
 %MfgName%=ECTIVA
 
After driver installation, the files are saved in the system directory as oem2.inf and oem2.cat. If not renamed to ECTIVA.inf and ECTIVA.cat when backing up, the WHQL digital signature will be invalid when updating the driver again. Driver Genius can only achieve oem2.inf and ECTIVA.cat.
 
Renaming code:
 
for /f "tokens=1* delims== " %%k in ('type "%inf%"^|find /i ".cat"') do set oemname=%%~nl 
if defined oemname for /f "delims=*" %%k in ('dir /s /b /a-d "%SystemRoot%\system32\CatRoot\%infname%.cat" 2^>nul') do set catfile=%%~k 
if not defined catfile for /f "delims=*" %%k in ('dir /s /b /a-d "%SystemRoot%\%oemname%.cat" 2^>nul') do set catfile=%%k 
if defined catfile ( 
           set infname=%oemname% 
           xcopy /h /r /y "%catfile%" "drivers\%class%\%name%\*.*">nul 2>>%log% 
           if errorlevel 0 color 0e&&echo  含WHQL数字签名 
           attrib -s -h -r "drivers\%class%\%name%\%infname%.*">nul 
           move /y "drivers\%class%\%name%\%infname%.inf" "drivers\%class%\%name%\%oemname%.inf">nul 2>nul 
           move /y "drivers\%class%\%name%\%infname%.cat" "drivers\%class%\%name%\%oemname%.cat">nul 2>nul 
) 
for /f "delims= " %%i in ('devcon hwids %ID%^|sed -n "/Hardware ID's:/{n;p;}"') do echo "%infname%.inf"****"%%~i">>"drivers\HardwareID.log"
 
 
 
 |  
                  |  第一高手    第二高手
 我的小站
 
  |  | 
|  2007-12-18 15:08 |  | 
|  | 
 
| pfox 银牌会员
 
      
 
 
 积分 1451
 发帖 446
 注册 2002-10-20
 状态 离线
 | 
| 『第 32 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
Originally posted by fastslz at 2007-12-18 02:27 PM:
 
 "drivers\PCI\Marvell Yukon Gigabit Ethernet 10_100_1000Base-T Adapter, Copper RJ-45\"文件名是合格的,这个驱动确实比较特殊,文件路径不对应说明该驱动也是未 ...
 
该驱动确实是使用setup.exe进行安装的,既然程序不存在问题那就暂时不管他了,回头我试一试驱动精灵看看备份是否正确。
 
看来是这个驱动比较特殊,驱动精灵备份的时候也无法备份该文件。
 
 Last edited by pfox on 2007-12-18 at 05:19 PM ] 
The driver is indeed installed using setup.exe. Since there is no problem with the program, we will leave it for now. I will try Driver Genius later to see if the backup is correct. It seems that this driver is relatively special, and Driver Genius cannot back up this file during the backup.
 Last edited by pfox on 2007-12-18 at 05:19 PM ]
 
 
 
 
 |  
                  |  
 我的下载空间
 |  | 
|  2007-12-18 17:10 |  | 
|  | 
 
| qq43142691 中级用户
 
    
 
 
 
 积分 326
 发帖 152
 注册 2007-5-4
 状态 离线
 | 
| 『第 33 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
你们都是火星来了哇~~~~~ 
Are you all just arrived from Mars?~~~~~ 
 
 
 |  | 
|  2008-1-7 08:58 |  | 
|  | 
 
| regvip2008 初级用户
 
   
 
 
 
 积分 187
 发帖 87
 注册 2007-10-23
 状态 离线
 | 
| 『第 34 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
这些问题太深奥了,我是看不懂!不过,还是顶 一下! 
These questions are too profound, I can't understand them! But still, give a thumbs up! 
 
 
 |  | 
|  2008-1-16 18:18 |  | 
|  | 
 
| dooomer 初级用户
 
   
 
 
 
 积分 109
 发帖 52
 注册 2006-1-3
 状态 离线
 |  | 
|  2008-1-18 12:10 |  | 
|  | 
 
| ttj36 初级用户
 
   
 
 
 
 积分 80
 发帖 37
 注册 2008-2-6
 状态 离线
 | 
| 『第 36 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
不错,老哥,这个批处太好用了,不过,基本里,好象打映机的备份不下来,是不是还要加上USBPRINT这个,请大哥指点
 
 Last edited by ttj36 on 2008-2-7 at 09:39 AM ]
 
Not bad, older brother. This batch process is too useful. However, in the basic, it seems that the backup of the printer can't be done. Is it necessary to add USBPRINT this? Please give guidance, big brother.
 Last edited by ttj36 on 2008-2-7 at 09:39 AM ]
 
 
 
 |  | 
|  2008-2-7 09:25 |  | 
|  | 
 
| fastslz 铂金会员
 
        DOS一根葱
 
 
 积分 5493
 发帖 2315
 注册 2006-5-1
 来自 上海
 状态 离线
 | 
| 『第 37 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
Originally posted by ttj36 at 2008-2-7 09:25:for %%a in (PCI PCIIDE USB IDE DISPLAY USBPRINT) do (不错,老哥,这个批处太好用了,不过,基本里,好象打映机的备份不下来,
 是不是还要加上USBPRINT这个,请大哥指点
 
 Last edited by ttj36 on 2008-2-7 at 09:39 AM ]
 ......
 
Originally posted by ttj36 at 2008-2-7 09:25:for %%a in (PCI PCIIDE USB IDE DISPLAY USBPRINT) do (Not bad, older brother, this batch processing is too easy to use, but, in the basic part, it seems that the backup of the projector cannot be saved, is it necessary to add USBPRINT? Please give me some advice
 
 Last edited by ttj36 on 2008-2-7 at 09:39 AM ]
 ......
 
 
 
 
 |  
                  |  第一高手    第二高手
 我的小站
 
  |  | 
|  2008-2-8 21:34 |  | 
|  | 
 
| ttj36 初级用户
 
   
 
 
 
 积分 80
 发帖 37
 注册 2008-2-6
 状态 离线
 | 
| 『第 38 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
还是备份不下来,怎么回事,呀,是不是并口打印机驱动 Parport USB打印机驱动 Usbprint    那怎么不好备份呢
 刚刚看了一下,还要把打印机插上才能备份下来,怎么回事,应该可以备份的呀,
 
 Last edited by ttj36 on 2008-2-9 at 01:10 PM ]
 
Still can't backup, what's the matter, ah, is it the parallel port printer driver Parport, USB printer driver Usbprint? Then why is it not easy to backup? Just now I saw that I also need to plug in the printer to backup, what's the matter, it should be able to backup ah,
 Last edited by ttj36 on 2008-2-9 at 01:10 PM ]
 
 
 
 |  | 
|  2008-2-9 12:49 |  | 
|  | 
 
| fastslz 铂金会员
 
        DOS一根葱
 
 
 积分 5493
 发帖 2315
 注册 2006-5-1
 来自 上海
 状态 离线
 | 
| 『第 39 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
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 find *^|find "\"') do call :startcopy "@%%b" "%%c"
 或范围更大点
 for /f "tokens=1* delims=: " %%b in ('devcon findall *^|find "\"') do call :startcopy "@%%b" "%%c"
 
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"
 )
 
 Replace with
 for /f "tokens=1* delims=: " %%b in ('devcon find *^|find "\""') do call :startcopy "@%%b" "%%c"
 Or a wider range
 for /f "tokens=1* delims=: " %%b in ('devcon findall *^|find "\""') do call :startcopy "@%%b" "%%c"
 
 
 
 
 |  
                  |  第一高手    第二高手
 我的小站
 
  |  | 
|  2008-2-9 20:03 |  | 
|  | 
 
| ttj36 初级用户
 
   
 
 
 
 积分 80
 发帖 37
 注册 2008-2-6
 状态 离线
 |  | 
|  2008-2-9 20:08 |  | 
|  | 
 
| ttj36 初级用户
 
   
 
 
 
 积分 80
 发帖 37
 注册 2008-2-6
 状态 离线
 | 
| 『第 41 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
我刚刚试过了改成for /f "tokens=1* delims=: " %%b in ('devcon find *^|find "\"') do echo "%%b"****"%%  驱动太多了,我又改成了for /f "tokens=1* delims=: " %%b in ('devcon findall %%a\*^|find "\"') do echo "%%b"****"%%这样,备份下来多出了,4个驱动,
 到,这样对不对,
 
I just tried changing it to for /f "tokens=1* delims=: " %%b in ('devcon find *^|find "\"') do echo "%%b"****"%% There are too many drivers,I changed it to for /f "tokens=1* delims=: " %%b in ('devcon findall %%a\*^|find "\"') do echo "%%b"****"%% like this, and there are 4 more drivers backed up,
 Is this correct?
 
 
 
 |  | 
|  2008-2-9 20:19 |  | 
|  | 
 
| fastslz 铂金会员
 
        DOS一根葱
 
 
 积分 5493
 发帖 2315
 注册 2006-5-1
 来自 上海
 状态 离线
 | 
| 『第 42 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
Originally posted by ttj36 at 2008-2-9 20:19:我刚刚试过了改成for /f "tokens=1* delims=: " %%b in ('devcon find *^|find "\"') do echo "%%b"****"%%  驱动太多了,
 我又改成了for /f "tokens ...
 
看下Drivers\HardwareID.log对应打印机驱动的那一部分 
Originally posted by ttj36 at 2008-2-9 20:19:I just tried changing it to for /f "tokens=1* delims=: " %%b in ('devcon find *^|find "\"') do echo "%%b"****"%% There are too many drivers,
 I changed it again to for /f "tokens ...
 
Take a look at the part corresponding to the printer driver in Drivers\HardwareID.log 
 
 
 
 |  
                  |  第一高手    第二高手
 我的小站
 
  |  | 
|  2008-2-9 20:29 |  | 
|  | 
 
| ttj36 初级用户
 
   
 
 
 
 积分 80
 发帖 37
 注册 2008-2-6
 状态 离线
 | 
| 『第 43 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
看了上面写,"hpf3500p.inf"****"USBPRINT\hpdeskjet_35007052"for /f "tokens=1* delims=: " %%b in ('devcon findall %%a\*^|find "\"') do echo "%%b"****"%%看来只能这么搞,不知道对不对,
 
 Last edited by ttj36 on 2008-2-9 at 08:37 PM ]
 
Read above  said, "hpf3500p.inf"****"USBPRINT\hpdeskjet_35007052"for /f "tokens=1* delims=: " %%b in ('devcon findall %%a\*\ | find "\"') do echo "%%b"****"%% seems can only do this, not sure if it's right,
 
 Last edited by ttj36 on 2008-2-9 at 08:37 PM ]
 
 
 
 |  | 
|  2008-2-9 20:31 |  | 
|  | 
 
| fastslz 铂金会员
 
        DOS一根葱
 
 
 积分 5493
 发帖 2315
 注册 2006-5-1
 来自 上海
 状态 离线
 | 
| 『第 44 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
确实比较奇怪,按道理for %%a in (PCI PCIIDE USB IDE DISPLAY USBPRINT) do ( 
这样应该能正确识别打印机的,要不你再试试
 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 %%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"
 )
 
看看这2种兼容性更大,如果在不能正确识别,要增加代码了
 
 Last edited by fastslz on 2008-2-9 at 08:55 PM ]
It's indeed quite strange. According to reason, for %%a in (PCI PCIIDE USB IDE DISPLAY USBPRINT) do ( 
This should be able to correctly identify the printer. Otherwise, you can try again
 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"
 )
 
Or
 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"
 )
 
See which of these 2 has greater compatibility. If it still can't be correctly identified, more code needs to be added
 
 Last edited by fastslz on 2008-2-9 at 08:55 PM ]
 
 
 
 |  
                  |  第一高手    第二高手
 我的小站
 
  |  | 
|  2008-2-9 20:52 |  | 
|  | 
 
| ttj36 初级用户
 
   
 
 
 
 积分 80
 发帖 37
 注册 2008-2-6
 状态 离线
 | 
| 『第 45 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
第一个还是不行,用第二,出是出来个不过好象不对,而且出错,
 
 "1 matching device(s) found."
 找不到文件 - monitor.inf
 
 十在不行,就算了,把打映机插上就行了,就是搞不懂不插上打映机,就不好备份,
 
 Last edited by ttj36 on 2008-2-9 at 09:13 PM ]
 
The first one still doesn't work.Use the second one. It comes out but it doesn't seem right and there's an error.
 
 "1 matching device(s) found."
 File not found - monitor.inf
 
 If it really doesn't work, forget it. Just plug in the projector. I just don't understand why it's not easy to backup without plugging in the projector.
 
 Last edited by ttj36 on 2008-2-9 at 09:13 PM ]
 
 
 
 |  | 
|  2008-2-9 21:03 |  |