中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net  论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

游客:  注册 | 登录 | 命令行 | 会员 | 搜索 | 上传 | 帮助 »
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » 请帮忙解决批处理驱动提取问题
作者:
标题: 请帮忙解决批处理驱动提取问题 上一主题 | 下一主题
lzwqxy
新手上路





积分 15
发帖 11
注册 2008-5-16
状态 离线
『楼 主』:  请帮忙解决批处理驱动提取问题

现有一驱动文件夹 DRIVER
里面有如下文件:
DATA.TAG
data1.cab
INSTALL.TXT
lang.dat
layout.bin
NBICDNT.DLL
os.dat
ps5333.inf
S3Displ2.cfg
S3Disply.cfg
s3disply.dll
S3DSPCHS.HLP
S3DSPCHT.HLP
S3DSPJPN.HLP
S3DSPKOR.HLP
S3DSPWST.HLP
S3GAMMA2.CFG
S3GAMMA2.DLL
S3GM2CHS.HLP
S3GM2CHT.HLP
S3GM2JPN.HLP
S3GM2KOR.HLP
S3GM2WST.HLP
S3gNB.dll
s3gNBm.sys
S3IN2CHS.HLP
S3IN2CHT.HLP
S3IN2JPN.HLP
S3IN2KOR.HLP
S3IN2WST.HLP
S3INFO2.CFG
S3INFO2.DLL
S3OVLCHS.HLP
S3OVLCHT.HLP
S3OVLJPN.HLP
S3OVLKOR.HLP
S3OVLWST.HLP
s3ovrlay.cfg
s3ovrlay.dll
s3psddr.cat
s3setup.dat
s3tray2.exe
S3UNINST.EXE
SETUP.EXE
SETUP.INI
setup.ins
setup.iss
setup.lid
setupdir
VTPreset.exe
_INST32I.EX_
_ISDEL.EXE
_sys1.cab
_user1.cab
我想根据ps5333.inf内的文件名,将DRIVER内的文件复制到另一个文件夹内。

───────────────── 版务记录 ─────────────────
执行:HAT
操作:[2008-10-13]删除原标题"高手进来解决批处理驱动提取问题!!!"中的挑衅性文字
处罚:扣除4点积分
提示:建议阅读以下帖子
{1415}提问的智慧
{7326}论坛新手必读,所有人的基本行为准则
{22703}请不要做浮躁的人
{32667}[愤怒]那些连标题都写不清楚的人们啊,你们醒醒吧
{32825}本版严厉整顿烂帖
───────────────── 版务记录 ─────────────────


[ Last edited by HAT on 2008-10-13 at 12:44 ]

   此帖被 -4 点积分     点击查看详情   
评分人:【 HAT 分数: -4  时间:2008-10-13 12:43


2008-10-10 10:52
查看资料  发短消息 网志   编辑帖子  回复  引用回复
tireless
银牌会员





积分 2025
发帖 1122
注册 2007-9-5
状态 离线
『第 2 楼』:  

ps5333.inf 内的文件名是如何排列的?

2008-10-10 11:17
查看资料  发短消息 网志   编辑帖子  回复  引用回复
HAT
版主





积分 9023
发帖 5017
注册 2007-5-31
状态 离线
『第 3 楼』:  

楼主是想让大家猜一下ps5333.inf文件的内容么?



2008-10-10 11:20
查看资料  发短消息 网志   编辑帖子  回复  引用回复
lzwqxy
新手上路





积分 15
发帖 11
注册 2008-5-16
状态 离线
『第 4 楼』:  

; PS5333.INF for S3 ProSavageDDR with ICD and S3Display, S3Gamma2, S3Info2 & S3Overlay
;
; Windows XP\Win2000 installation file (.INF) for the S3 Graphics, Inc. display driver
; for ProSavageDDR
;
; Copyright (c) 1999, 2000 By S3 Incorporated.
; Copyright (c) 2001, 2002, 2003, 2004 By S3 Graphics, Inc.
;

[Version]
Signature="$CHICAGO$"
Class=Display
ClassGUID={4D36E968-E325-11CE-BFC1-08002BE10318}
Provider=%INF_Provider%
CatalogFile=s3psddr.cat
DriverVer=08/13/2004, 6.14.10.0033
;13.94.33

[ControlFlags]
ExcludeFromSelect = PCI\VEN_5333&DEV_8D04
                                                                         
;
;  Disk and Directory sections
;

[DestinationDirs]
DefaultDestDir      = 11
S3Psddr.Miniport   = 12   ; drivers
S3Psddr.Display    = 11   ; system32
S3Psddr.Icd        = 11
S3DispSys.Copy      = 11
S3DispHlp.Copy      = 18
S3UninstSys.Copy    = 11
GAMMA2copy.sys      = 11
GAMMA2copy.hlp      = 18
Info2Sys.Copy            = 11
Info2Hlp.Copy            = 18
OverlaySys.Copy            = 11
OverlayHlp.Copy            = 18

[SourceDisksNames.x86]
1 = %DiskId%,,,""

[SourceDisksFiles]
s3gnbm.sys       = 1 ;all files are on Disk 1
s3gnb.dll        = 1
; For ICD
nbicdnt.dll     = 1
; For S3Display
S3Disply.dll    = 1
S3Disply.cfg    = 1
S3Displ2.cfg    = 1
S3DspWST.hlp    = 1
S3DspCHS.hlp    = 1
S3DspCHT.hlp    = 1
S3DspJPN.hlp    = 1
S3DspKOR.hlp    = 1

;  For S3Gamma2
S3Gamma2.dll    = 1
S3Gamma2.cfg    = 1
S3Gm2WST.hlp    = 1
S3Gm2CHS.hlp    = 1
S3Gm2CHT.hlp    = 1
S3Gm2JPN.hlp    = 1
S3Gm2KOR.hlp    = 1
;  For S3Info2
s3info2.dll     = 1
s3info2.cfg     = 1
s3in2wst.hlp    = 1
s3in2chs.hlp    = 1
s3in2cht.hlp    = 1
s3in2jpn.hlp    = 1
s3in2kor.hlp    = 1
;  For S3Overlay
s3ovrlay.dll    = 1
s3ovrlay.cfg    = 1
s3ovlwst.hlp    = 1
s3ovlchs.hlp    = 1
s3ovlcht.hlp    = 1
s3ovljpn.hlp    = 1
s3ovlkor.hlp    = 1
;  For S3Uninst
S3uninst.exe    = 1
VTPreset.exe     = 1

;
; Driver information
;

[Manufacturer]
%S3%   = S3.Mfg

;
; This section should be modified to reflect the chip strings the
; user will see in the Displays applet when the new driver is being
; installed from the driver diskette.
;
[S3.Mfg]
S3 Graphics ProSavageDDR = S3Psddr, PCI\VEN_5333&DEV_8D04

;
; General installation section
;

[S3Psddr]
CopyFiles = S3Psddr.Miniport, S3Psddr.Display, S3Psddr.Icd, S3DispHlp.Copy, S3DispSys.Copy, Info2Hlp.Copy, Info2Sys.Copy, S3UninstSys.Copy, GAMMA2copy.hlp, GAMMA2copy.sys, OverlayHlp.Copy, OverlaySys.Copy
AddReg    = S3Psddr.AddRegs, S3DispNT.AddReg, S3Gamma2NT.AddReg, Info2NT.AddReg, OverlayNT.AddReg

;
; File sections
;

[S3Psddr.Miniport]
s3gnbm.sys      ; miniport driver

[S3Psddr.Display]
s3gnb.dll       ; Savage4 display driver

[S3Psddr.Icd]
nbicdnt.dll    ; OpenGL ICD driver

[S3Psddr.AddRegs]
HKLM,Software\Microsoft\%WinNTDir%\CurrentVersion\OpenGLdrivers,SavageNB,,"nbicdnt"

[S3Psddr.GeneralConfigData]
MaximumDeviceMemoryConfiguration=128

;
; Service Installation
;

[S3Psddr.Services]
AddService = S3Psddr, 0x00000002, S3Psddr_Service_Inst, S3Psddr_EventLog_Inst


[S3Psddr_Service_Inst]
ServiceType    = 1                  ; SERVICE_KERNEL_DRIVER
StartType      = 3                  ; SERVICE_DEMAND_START
ErrorControl   = 0                  ; SERVICE_ERROR_IGNORE
LoadOrderGroup = Video
ServiceBinary  = %12%\s3gnbm.sys

[S3Psddr_EventLog_Inst]
AddReg = S3Psddr_EventLog_AddReg

[S3Psddr_EventLog_AddReg]
HKR,,EventMessageFile,0x00020000,"%SystemRoot%\System32\IoLogMsg.dll;%SystemRoot%\System32\drivers\s3gnbm.sys"
HKR,,TypesSupported,0x00010001,7

;
; Software Installation
;

[S3Psddr.SoftwareSettings]
AddReg = S3Psddr_SoftwareDeviceSettings
DelReg = S3Psddr_UserPreferences   ; user-selected preferences


[S3Psddr_SoftwareDeviceSettings]
HKR,, InstalledDisplayDrivers,      %REG_MULTI_SZ%, s3gnb
HKR,, VgaCompatible,                %REG_DWORD%,    0
HKR,, CapabilityOverride,           %REG_DWORD%,    0
HKR,, SupportIcd,                   %REG_DWORD%,    1
HKR,, PruningMode,                  %REG_DWORD%,    1

[S3Psddr_UserPreferences]
HKR,, UseDDCInfo
HKR,, NtscTvPositionX
HKR,, NtscTvPositionY
HKR,, Pal6TvPositionX
HKR,, Pal6TvPositionY
HKR,, Pal8TvPositionX
HKR,, Pal8TvPositionY
HKR,, DisplaysActivePreference
HKR,, TvStandardPreference
HKR,, DdcMaxRefresh
HKR,, GammaFor16BppModes
HKR,, GammaFor32BppModes

[Strings]

;
; Non-Localizable Strings
;

REG_MULTI_SZ   = 0x00010000
REG_DWORD      = 0x00010001

;
; Localizable Strings
;

DiskId         = "S3 Graphics, Inc. Installation DISK (VIDEO)"
S3             = "S3 Graphics, Inc."
INF_Provider   = "S3 Graphics, Inc."
WinNTDir       = "Windows NT"

;  For S3Display
CtrlFld    = "Controls Folder"
CURVER     = "Software\Microsoft\Windows\CurrentVersion"
S3DISPCLS  = "{a3b69838-fc13-48b9-9438-beaf0eda660a}"
S3DISPNAME = "S3Display"
S3DSPKEY   = "SOFTWARE\S3\S3Display"

;  For S3Gamma
S3SRVC     = "S3Psddr"
  ;; Strings specific to this utility
SGm2Desc  = "S3Gamma2"
GM2CLSID  = "{46b23a80-2895-11d3-bfcb-00aa0022f384}"
GM2NAME   = "S3Gamma2"
S3G2KEY   = "SOFTWARE\S3\S3Gamma2"

; For S3Info2
INFO2CLS   = "{48429801-16E6-11d4-8ECD-00609784BD62}"
INFO2NAME  = "S3Info2"
INFO2KEY   = "SOFTWARE\S3\S3Info2"

; For S3Overlay
OVERLAYCLS = "{6c146c80-66e8-11d3-88af-00600837776e}"
OVERLAYNAME= "S3Overlay"
OVERLAYKEY = "SOFTWARE\S3\S3Overlay"

;;
;;   S3 Display
;;

[S3DispSys.Copy]
S3Disply.dll
S3Disply.cfg
S3Displ2.cfg

[S3DispHlp.Copy]
S3DspWST.hlp
S3DspCHS.hlp
S3DspCHT.hlp
S3DspJPN.hlp
S3DspKOR.hlp

[S3UninstSys.Copy]
S3uninst.exe
VTPreset.exe

[Info2Sys.Copy]
S3Info2.dll
S3Info2.cfg

[Info2Hlp.Copy]
s3in2wst.hlp
s3in2chs.hlp
s3in2cht.hlp
s3in2jpn.hlp
s3in2kor.hlp

[OverlaySys.Copy]
S3Ovrlay.dll
S3Ovrlay.cfg

[OverlayHlp.Copy]
s3ovlwst.hlp
s3ovlchs.hlp
s3ovlcht.hlp
s3ovljpn.hlp
s3ovlkor.hlp

[S3DispNT.AddReg]
HKLM,%CURVER%\Uninstall\S3Display,DisplayName,,%S3DISPNAME%
HKLM,%CURVER%\Uninstall\S3Display,UninstallString,,"s3uninst.exe -reg 5 'HKLM\Software\S3\S3Uninst\S3Display'"
HKCR,CLSID\%S3DISPCLS%,,,"S3Display Property Sheet"
HKCR,CLSID\%S3DISPCLS%\InProcServer32,,,S3Disply.dll
HKCR,CLSID\%S3DISPCLS%\InProcServer32,ThreadingModel,,Apartment
HKLM,%CURVER%\%CtrlFld%\Display\shellex\PropertySheetHandlers\S3Display,"",,%S3DISPCLS%
HKLM,%S3DSPKEY%,Installed,,1
HKLM,%S3DSPKEY%,Filename,,S3Disply.dll
HKLM,%S3DSPKEY%,UtilityName,,%S3DISPNAME%
HKLM,%S3DSPKEY%,ConfigNum,,0
HKLM,%S3DSPKEY%,URL,,http://www.s3graphics.com

HKLM,SOFTWARE\S3\S3Control,TrayIcon,,"none"

;; -------------------- Uninstallation information ---------------------
HKLM,"Software\S3\S3Uninst\S3Display","10.DelKey",,HKLM\%S3DSPKEY%
HKLM,"Software\S3\S3Uninst\S3Display","11.DelKey",,HKCR\CLSID\%S3DISPCLS%
HKLM,"Software\S3\S3Uninst\S3Display","12.DelKey",,HKLM\%CURVER%\Uninstall\S3Display
HKLM,"Software\S3\S3Uninst\S3Display","13.DelKey",,HKLM\%CURVER%\%CtrlFld%\Display\shellex\PropertySheetHandlers\S3Display
HKLM,"Software\S3\S3Uninst\S3Display","20.DelFiles",,%11%\S3Disply.dll
HKLM,"Software\S3\S3Uninst\S3Display","21.DelFiles",,%18%\S3Dsp*.hlp
HKLM,"Software\S3\S3Uninst\S3Display","22.DelFiles",,%11%\S3Displ*.cfg
HKLM,"Software\S3\S3Uninst\S3Display","23.DelFiles",,%17%\S3Disply.?nf
HKLM,"Software\S3\S3Uninst\S3Display","23.DelFiles",,%11%\VTPreset.exe
HKLM,"Software\S3\S3Uninst\S3Display","30.DelKey",,"HKLM\Software\Microsoft\Windows\CurrentVersion\Run\VTPreset"

;;
;;   S3 Gamma2
;;

[GAMMA2copy.sys]
S3Gamma2.dll
S3Gamma2.cfg

[GAMMA2copy.hlp]
S3Gm2WST.hlp
S3Gm2CHS.hlp
S3Gm2CHT.hlp
S3Gm2JPN.hlp
S3Gm2KOR.hlp

[S3Gamma2NT.AddReg]
HKLM,"%CURVER%\Uninstall\S3Gamma2",DisplayName,,"%SGm2Desc%"
HKLM,"%CURVER%\Uninstall\S3Gamma2","UninstallString",,"s3uninst.exe -reg 5 'HKLM\Software\S3\S3Uninst\S3Gamma2'"
HKCR,"CLSID\%GM2CLSID%",,,"S3Gamma2 Property Sheet"
HKCR,"CLSID\%GM2CLSID%\InProcServer32",,,"S3Gamma2.dll"
HKCR,"CLSID\%GM2CLSID%\InProcServer32",ThreadingModel,,"Apartment"
HKLM,"%CURVER%\%CtrlFld%\Display\shellex\PropertySheetHandlers\S3Gamma2","",,"%GM2CLSID%"
HKLM,"%S3G2KEY%","Installed",,"1"
HKLM,"%S3G2KEY%","Filename",,"S3Gamma2.dll"
HKLM,"%S3G2KEY%","UtilityName",,"%GM2NAME%"
HKLM,"%S3G2KEY%","URL",,"http://www.s3graphics.com"

;; ---------- Following lines are uninstall information ------------
HKLM,"Software\S3\S3Uninst\S3Gamma2","10.DelKey",,"HKLM\%S3G2KEY%"
HKLM,"Software\S3\S3Uninst\S3Gamma2","11.DelKey",,"HKCR\CLSID\%GM2CLSID%"
HKLM,"Software\S3\S3Uninst\S3Gamma2","12.DelKey",,"HKLM\%CURVER%\Uninstall\S3Gamma2"
HKLM,"Software\S3\S3Uninst\S3Gamma2","13.DelKey",,"HKLM\%CURVER%\%CtrlFld%\Display\shellex\PropertySheetHandlers\S3Gamma2"
HKLM,"Software\S3\S3Uninst\S3Gamma2","20.DelFiles",,"%11%\S3Gamma2.dll"
HKLM,"Software\S3\S3Uninst\S3Gamma2","21.DelFiles",,"%18%\S3Gm2*.hlp"
HKLM,"Software\S3\S3Uninst\S3Gamma2","22.DelFiles",,"%11%\S3Gamma2.cfg"
HKLM,"Software\S3\S3Uninst\S3Gamma2","23.DelFiles",,"%17%\S3Gamma2.?nf"

;; ---------- The following section is for NT/Win2K S3Info2 ------------
[Info2NT.AddReg]
HKLM,%CURVER%\Uninstall\S3Info2,DisplayName,,%INFO2NAME%
HKLM,%CURVER%\Uninstall\S3Info2,UninstallString,,"s3uninst.exe -reg 5 'HKLM\Software\S3\S3Uninst\S3Info2'"
HKCR,CLSID\%INFO2CLS%,,,"S3Info2 Property Sheet"
HKCR,CLSID\%INFO2CLS%\InProcServer32,,,S3Info2.dll
HKCR,CLSID\%INFO2CLS%\InProcServer32,ThreadingModel,,Apartment
HKLM,%CURVER%\%CtrlFld%\Display\shellex\PropertySheetHandlers\S3Info2,"",,%INFO2CLS%
HKLM,%INFO2KEY%,Filename,,S3Info2.dll
HKLM,%INFO2KEY%,URL,,http://www.s3graphics.com

;; -------------------- Uninstall information, S3Info2 ---------------------
HKLM,"Software\S3\S3Uninst\S3Info2","10.DelKey",,HKLM\%INFO2KEY%
HKLM,"Software\S3\S3Uninst\S3Info2","11.DelKey",,HKCR\CLSID\%INFO2CLS%
HKLM,"Software\S3\S3Uninst\S3Info2","12.DelKey",,HKLM\%CURVER%\Uninstall\S3Info2
HKLM,"Software\S3\S3Uninst\S3Info2","13.DelKey",,HKLM\%CURVER%\%CtrlFld%\Display\shellex\PropertySheetHandlers\S3Info2
HKLM,"Software\S3\S3Uninst\S3Info2","20.DelFiles",,%11%\S3Info2.dll
HKLM,"Software\S3\S3Uninst\S3Info2","21.DelFiles",,%18%\S3In2*.hlp
HKLM,"Software\S3\S3Uninst\S3Info2","22.DelFiles",,%11%\S3Info2.cfg
HKLM,"Software\S3\S3Uninst\S3Info2","23.DelFiles",,%17%\S3Info2.?nf

;; ---------- The following section is for NT/Win2K S3Overlay ------------
[OverlayNT.AddReg]
HKLM,%CURVER%\Uninstall\S3Overlay,DisplayName,,%OVERLAYNAME%
HKLM,%CURVER%\Uninstall\S3Overlay,UninstallString,,"s3uninst.exe -reg 5 'HKLM\Software\S3\S3Uninst\S3Overlay'"
HKCR,CLSID\%OVERLAYCLS%,,,"S3Overlay Property Sheet"
HKCR,CLSID\%OVERLAYCLS%\InProcServer32,,,S3Ovrlay.dll
HKCR,CLSID\%OVERLAYCLS%\InProcServer32,ThreadingModel,,Apartment
HKLM,%CURVER%\%CtrlFld%\Display\shellex\PropertySheetHandlers\S3Overlay,"",,%OVERLAYCLS%
HKLM,%OVERLAYKEY%,Filename,,S3Ovrlay.dll

;; -------------------- Uninstallation information ---------------------
HKLM,"Software\S3\S3Uninst\S3Overlay","10.DelKey",,HKLM\%OVERLAYKEY%
HKLM,"Software\S3\S3Uninst\S3Overlay","11.DelKey",,HKCR\CLSID\%OVERLAYCLS%
HKLM,"Software\S3\S3Uninst\S3Overlay","12.DelKey",,HKLM\%CURVER%\Uninstall\S3Overlay
HKLM,"Software\S3\S3Uninst\S3Overlay","13.DelKey",,HKLM\%CURVER%\%CtrlFld%\Display\shellex\PropertySheetHandlers\S3Overlay
HKLM,"Software\S3\S3Uninst\S3Overlay","20.DelFiles",,%11%\S3Ovrlay.dll
HKLM,"Software\S3\S3Uninst\S3Overlay","21.DelFiles",,%18%\S3Ovl*.hlp
HKLM,"Software\S3\S3Uninst\S3Overlay","22.DelFiles",,%11%\S3Ovrlay.cfg
HKLM,"Software\S3\S3Uninst\S3Overlay","23.DelFiles",,%17%\S3Ovrlay.?nf

HKLM,Software\Microsoft\Windows\CurrentVersion\Run,VTPreset,,"VTPreset.exe"

2008-10-10 12:05
查看资料  发短消息 网志   编辑帖子  回复  引用回复
tireless
银牌会员





积分 2025
发帖 1122
注册 2007-9-5
状态 离线
『第 5 楼』:  


@echo off
for /f "skip=44" %%a in (PS5333.INF) do (
      if %%a==[Manufacturer] (exit /b) else (
         copy "DRIVER\%%a" "另一个文件夹"
      )
)


2008-10-10 15:30
查看资料  发短消息 网志   编辑帖子  回复  引用回复
huahua0919
银牌会员




积分 1608
发帖 780
注册 2007-10-7
状态 离线
『第 6 楼』:  

是不是楼主的驱动程序.inf中的驱动类型有多种,导致在用程序安装的时候不好指定特定驱动程序。

2008-10-10 15:54
查看资料  发送邮件  访问主页  发短消息 网志   编辑帖子  回复  引用回复
lzwqxy
新手上路





积分 15
发帖 11
注册 2008-5-16
状态 离线
『第 7 楼』:  

5楼的差不多,但是提取的还不完整
主要是把 IN F内的文件名提取出来就可以了

2008-10-11 10:39
查看资料  发短消息 网志   编辑帖子  回复  引用回复
knoppix7
银牌会员





积分 1287
发帖 634
注册 2007-5-2
来自 cmd.exe
状态 离线
『第 8 楼』:  

好那啥的语气.
我不当高手..

2008-10-11 15:46
查看资料  发短消息 网志   编辑帖子  回复  引用回复
tireless
银牌会员





积分 2025
发帖 1122
注册 2007-9-5
状态 离线
『第 9 楼』:  


@echo off
for /f "skip=27" %%a in (PS5333.INF) do (
     if %%a==[SourceDisksNames.x86] (goto 2) else copy "DRIVER\%%a" "另一个文件夹" 2>nul
)

:2
for /f "skip=44" %%a in (PS5333.INF) do (
     if %%a==[Manufacturer] (goto 3) else copy "DRIVER\%%a" "另一个文件夹" 2>nul
)

:3
for /f "skip=114 eol=[ delims=,;" %%a in (PS5333.INF) do (
     if %%a==HKLM (goto 4) else copy "DRIVER\%%a" "另一个文件夹" 2>nul
)

:4
for /f "skip=228 eol=[ delims=," %%a in (PS5333.INF) do (
     if %%a==HKLM (exit) else copy "DRIVER\%%a" "另一个文件夹" 2>nul
)


2008-10-11 15:48
查看资料  发短消息 网志   编辑帖子  回复  引用回复

请注意:您目前尚未注册或登录,请您注册登录以使用论坛的各项功能,例如发表和回复帖子等。


可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题



论坛跳转: