Extract characters with similar formats from files, and these files are not in the same directory
First, let's explain:
The files from which you need to extract content are distributed in different folders. And the levels of the folders where they are located are also different. At the same time, you also need to append the path of the file to the output content.
Here is the folder structure:
C:\SRS-DRV
├─3
│ ├─1
│ │ └─O
│ ├─2
│ └─3
├─A
│ ├─1
│ ├─2
│ ├─3
│ ├─4
│ ├─5
│ ├─6
│ ├─7
│ └─8
├─AD
│ ├─1
│ ├─2
│ ├─3
│ ├─4
│ ├─5
│ ├─6
│ │ └─C
│ ├─7
│ ├─8
│ ├─9
│ └─A
├─AM
├─AR
├─AT
├─AU
│ ├─1
│ ├─2
│ └─3
├─C
├─D
│ ├─1
│ ├─2
│ └─3
├─E
├─H
│ ├─1
│ │ └─R
│ ├─2
│ ├─3
│ ├─4
│ ├─5
│ ├─6
│ │ └─2k3
│ ├─7
│ └─8
├─I
│ ├─1
│ ├─2
│ ├─3
│ ├─4
│ ├─5
│ └─6
├─IN
│ ├─1
│ │ └─O
│ └─2
│ └─winnt
│ └─x86
├─IT
├─J
│ ├─1
│ └─2
├─L
│ ├─1
│ ├─2
│ ├─3
│ ├─4
│ └─5
├─M
│ └─O
├─N
│ ├─123
│ ├─4
│ │ ├─I
│ │ └─R
│ ├─4INTEL
│ │ ├─I
│ │ └─R
│ ├─590SLI
│ │ ├─I
│ │ └─R
│ └─TM
├─P
│ ├─1
│ ├─2
│ │ └─A
│ ├─3
│ ├─4
│ ├─5
│ ├─6
│ ├─7
│ ├─8
│ └─9
├─Q
│ ├─1
│ ├─2
│ ├─3
│ └─4
├─S
│ ├─1
│ ├─2
│ ├─3
│ ├─4
│ ├─5
│ │ └─A
│ ├─6
│ ├─7
│ │ └─A
│ ├─8
│ ├─9
│ ├─A
│ ├─B
│ └─C
├─SI
│ ├─1
│ ├─2
│ └─3
├─V
│ ├─1
│ ├─2
│ └─3
└─VM
Basically, there is an INF file with the extension .INF under each folder. If there is content similar to the red part below in that INF file, output it to 1.TXT (if there are multiple lines like this in a file, all should be output), and append the path of the file to the output content. (If a file has multiple matching places, output all of them and add the path of the file at the end of each line, for example, the blue parts below.)
For example:
PCI\VEN_13C1&DEV_1000=C:\SRS-DRV\3\3\oemsetup3.inf
PCI\VEN_1191&DEV_0002&SUBSYS_00021191=C:\SRS-DRV\A\1\Aec6210.inf
PCI\VEN_1191&DEV_0006&SUBSYS_00061191&REV_01=C:\SRS-DRV\A\2\Aec6260.inf
PCI\VEN_1022&DEV_7409=C:\SRS-DRV\AM\AMDEIDE.inf
PCI\VEN_1022&DEV_7411=C:\SRS-DRV\AM\AMDEIDE.inf
PCI\VEN_1022&DEV_7441=C:\SRS-DRV\AM\AMDEIDE.inf
PCI\VEN_1022&DEV_7469=C:\SRS-DRV\AM\AMDEIDE.inf
The part in front is extracted from the file, and the part after the equal sign is the path of the file from which the content is extracted.
The content to be extracted has several similar characteristics:
1. All start with PCI\VEN. (Note: Here it means that the content I want to extract starts with PCI\VEN, not that the line where this content is located starts with PCI\VEN. Only the content between PCI\VEN and containing one "\" is needed, and content with more than one "\" is not needed.)
2. There are two separators "_" and "&" in the content, and the number of separators is different.
The files on the page of the following link are used to make the 1.TXT file, and the directory tree structure above is that of the link file.
http://driverpacks.net/DriverPacks/download.php?pag=m
The files used are downloadable on the above link page. I have too low a level and seem unable to upload attachments for now!
Thank you all here in advance, great experts.
The original intention of hoping to implement the above function with a batch script:
Original post address of the quoted article http://bbs.mscode.cc/thread-51438-1-2.html
[ Last edited by baikaifang on 2007-6-3 at 08:04 PM ]
First, let's explain:
The files from which you need to extract content are distributed in different folders. And the levels of the folders where they are located are also different. At the same time, you also need to append the path of the file to the output content.
Here is the folder structure:
C:\SRS-DRV
├─3
│ ├─1
│ │ └─O
│ ├─2
│ └─3
├─A
│ ├─1
│ ├─2
│ ├─3
│ ├─4
│ ├─5
│ ├─6
│ ├─7
│ └─8
├─AD
│ ├─1
│ ├─2
│ ├─3
│ ├─4
│ ├─5
│ ├─6
│ │ └─C
│ ├─7
│ ├─8
│ ├─9
│ └─A
├─AM
├─AR
├─AT
├─AU
│ ├─1
│ ├─2
│ └─3
├─C
├─D
│ ├─1
│ ├─2
│ └─3
├─E
├─H
│ ├─1
│ │ └─R
│ ├─2
│ ├─3
│ ├─4
│ ├─5
│ ├─6
│ │ └─2k3
│ ├─7
│ └─8
├─I
│ ├─1
│ ├─2
│ ├─3
│ ├─4
│ ├─5
│ └─6
├─IN
│ ├─1
│ │ └─O
│ └─2
│ └─winnt
│ └─x86
├─IT
├─J
│ ├─1
│ └─2
├─L
│ ├─1
│ ├─2
│ ├─3
│ ├─4
│ └─5
├─M
│ └─O
├─N
│ ├─123
│ ├─4
│ │ ├─I
│ │ └─R
│ ├─4INTEL
│ │ ├─I
│ │ └─R
│ ├─590SLI
│ │ ├─I
│ │ └─R
│ └─TM
├─P
│ ├─1
│ ├─2
│ │ └─A
│ ├─3
│ ├─4
│ ├─5
│ ├─6
│ ├─7
│ ├─8
│ └─9
├─Q
│ ├─1
│ ├─2
│ ├─3
│ └─4
├─S
│ ├─1
│ ├─2
│ ├─3
│ ├─4
│ ├─5
│ │ └─A
│ ├─6
│ ├─7
│ │ └─A
│ ├─8
│ ├─9
│ ├─A
│ ├─B
│ └─C
├─SI
│ ├─1
│ ├─2
│ └─3
├─V
│ ├─1
│ ├─2
│ └─3
└─VM
Basically, there is an INF file with the extension .INF under each folder. If there is content similar to the red part below in that INF file, output it to 1.TXT (if there are multiple lines like this in a file, all should be output), and append the path of the file to the output content. (If a file has multiple matching places, output all of them and add the path of the file at the end of each line, for example, the blue parts below.)
For example:
PCI\VEN_13C1&DEV_1000=C:\SRS-DRV\3\3\oemsetup3.inf
PCI\VEN_1191&DEV_0002&SUBSYS_00021191=C:\SRS-DRV\A\1\Aec6210.inf
PCI\VEN_1191&DEV_0006&SUBSYS_00061191&REV_01=C:\SRS-DRV\A\2\Aec6260.inf
PCI\VEN_1022&DEV_7409=C:\SRS-DRV\AM\AMDEIDE.inf
PCI\VEN_1022&DEV_7411=C:\SRS-DRV\AM\AMDEIDE.inf
PCI\VEN_1022&DEV_7441=C:\SRS-DRV\AM\AMDEIDE.inf
PCI\VEN_1022&DEV_7469=C:\SRS-DRV\AM\AMDEIDE.inf
The part in front is extracted from the file, and the part after the equal sign is the path of the file from which the content is extracted.
The content to be extracted has several similar characteristics:
1. All start with PCI\VEN. (Note: Here it means that the content I want to extract starts with PCI\VEN, not that the line where this content is located starts with PCI\VEN. Only the content between PCI\VEN and containing one "\" is needed, and content with more than one "\" is not needed.)
2. There are two separators "_" and "&" in the content, and the number of separators is different.
The files on the page of the following link are used to make the 1.TXT file, and the directory tree structure above is that of the link file.
http://driverpacks.net/DriverPacks/download.php?pag=m
The files used are downloadable on the above link page. I have too low a level and seem unable to upload attachments for now!
Thank you all here in advance, great experts.
The original intention of hoping to implement the above function with a batch script:
The original post is quoted from the Dragon Empire Forum, posted by eyeshare on 07-5-3 11:07
The experience of loading SATA RAID SCSI drivers before encapsulation, which can be used without modification of SRS
I think the most important thing in making a ghost system is the judgment of the power mode and the accurate loading of SRS drivers. Now the judgment of the power mode has a very good solution, and the most main problem is now how to load the SRS drivers before encapsulation and uninstall the redundant drivers during the minimal installation to speed up the system boot speed. In fact, referring to Microsoft's deployment documents can solve it. Now I will talk about my method (I won't say much about other steps before encapsulation, such as changing the power mode, etc.)
1. Collect the required SRS drivers, which can be directly downloaded from the massstorage drivers of DPS.
http://www.driverpacks.net/DriverPacks/download.php?pag=m
2. Extract the drivers to c:\drivers.
3. Edit sysprep.ini and add the following content
InstallFilesPath=C:\sysprep\i386
PCI\VEN_1022&DEV_7469=c:\drivers\m\am\AMDEIDE.inf
PCI\VEN_1002&DEV_4349=c:\drivers\m\at\atiide.inf
PCI\VEN_10B9&DEV_5215=c:\drivers\m\au\1\ALIIDE.INF
PCI\VEN_10B9&DEV_5219=c:\drivers\m\au\1\ALIIDE.INF
PCI\VEN_10B9&DEV_5229=c:\drivers\m\au\1\ALIIDE.INF
PCI\VEN_10B9&DEV_5228=c:\drivers\m\au\2\m5228.INF
PCI\VEN_10B9&DEV_5281=c:\drivers\m\au\2\m5281.inf
PCI\VEN_10B9&DEV_5287=c:\drivers\m\au\3\ulisata.inf
PCI\VEN_10B9&DEV_5288=c:\drivers\m\au\4\ULISATA.INF
PCI\VEN_10B9&DEV_5289=c:\drivers\m\au\5\ULISATA.INF
PCI\VEN_8086&DEV_2652&CC_0104=c:\drivers\m\in\1\iastor.inf
PCI\VEN_8086&DEV_27C3&CC_0104=c:\drivers\m\in\1\iastor.inf
PCI\VEN_8086&DEV_2682&CC_0104=c:\drivers\m\in\1\iastor.inf
PCI\VEN_8086&DEV_27C6&CC_0104=c:\drivers\m\in\1\iastor.inf
PCI\VEN_8086&DEV_2822&CC_0104=c:\drivers\m\in\1\iastor.inf
PCI\VEN_8086&DEV_2652&CC_0106=c:\drivers\m\in\1\iaahci.inf
PCI\VEN_8086&DEV_2653&CC_0106=c:\drivers\m\in\1\iaahci.inf
PCI\VEN_8086&DEV_27C1&CC_0106=c:\drivers\m\in\1\iaahci.inf
PCI\VEN_8086&DEV_27C5&CC_0106=c:\drivers\m\in\1\iaahci.inf
PCI\VEN_8086&DEV_2681&CC_0106=c:\drivers\m\in\1\iaahci.inf
PCI\VEN_8086&DEV_2821&CC_0106=c:\drivers\m\in\1\iaahci.inf
PCI\VEN_8086&DEV_24DF&CC_0104=c:\drivers\m\in\1\O\iastor.inf
PCI\VEN_8086&DEV_25B0&CC_0104=c:\drivers\m\in\1\O\iastor.inf
PCI\VEN_10DE&DEV_008E=c:\drivers\m\N\TM\nvatabus.inf
PCI\VEN_10DE&DEV_00D5=c:\drivers\m\N\TM\nvatabus.inf
PCI\VEN_10DE&DEV_00EE=c:\drivers\m\N\TM\nvatabus.inf
PCI\VEN_10DE&DEV_00E3=c:\drivers\m\N\TM\nvatabus.inf
PCI\VEN_10DE&DEV_0036=c:\drivers\m\N\TM\nvatabus.inf
PCI\VEN_10DE&DEV_003E=c:\drivers\m\N\TM\nvatabus.inf
PCI\VEN_10DE&DEV_0054=c:\drivers\m\N\TM\nvatabus.inf
PCI\VEN_10DE&DEV_0055=c:\drivers\m\N\TM\nvatabus.inf
PCI\VEN_10DE&DEV_0266=c:\drivers\m\N\TM\nvatabus.inf
PCI\VEN_10DE&DEV_0267=c:\drivers\m\N\TM\nvatabus.inf
PCI\VEN_10DE&DEV_036F=c:\drivers\m\N\TM\nvatabus.inf
PCI\VEN_10DE&DEV_037E=c:\drivers\m\N\TM\nvatabus.inf
PCI\VEN_10DE&DEV_037F=c:\drivers\m\N\TM\nvatabus.inf
PCI\VEN_10DE&DEV_03F6=c:\drivers\m\N\TM\nvatabus.inf
PCI\VEN_10DE&DEV_03F7=c:\drivers\m\N\TM\nvatabus.inf
PCI\VEN_10DE&DEV_03E7=c:\drivers\m\N\TM\nvatabus.inf
PCI\VEN_1039&DEV_0181=c:\drivers\M\SI\1\SISRaid1.INF
PCI\VEN_1039&DEV_0180=c:\drivers\M\SI\2\SISRaid.INF
PCI\VEN_1039&DEV_0182=c:\drivers\M\SI\3\SISRaid2.INF
PCI\VEN_1106&DEV_3349&CC_0104=c:\drivers\M\V\1\VIAMRAID.INF
PCI\VEN_1106&DEV_6287&CC_0106=c:\drivers\M\V\1\VIAMRAID.INF
PCI\VEN_1106&DEV_0591&CC_0104=c:\drivers\M\V\1\VIAMRAID.INF
PCI\VEN_1106&DEV_3249&CC_0104=c:\drivers\M\V\1\VIAMRAID.INF
PCI\VEN_1106&DEV_3149&CC_0104=c:\drivers\M\V\1\VIAMRAID.INF
PCI\VEN_1106&DEV_3164&CC_0104=c:\drivers\M\V\1\VIAMRAID.INF
PCI\VEN_1106&DEV_0581&CC_0104=c:\drivers\M\V\1\VIAMRAID.INF
PCI\VEN_1106&DEV_7372&CC_0104=c:\drivers\M\V\1\VIAMRAID.INF
PCI\VEN_1106&DEV_4149=c:\drivers\M\V\2\viapide.inf
PCI\VEN_1106&DEV_0571=c:\drivers\M\V\3\vminiide.inf
PCI\VEN_1106&DEV_3149&CC_0101=c:\drivers\M\V\3\vminiide.inf
PCI\VEN_1106&DEV_0591&CC_0101=c:\drivers\M\V\3\vminiide.inf
PCI\VEN_1106&DEV_5337&CC_0101=c:\drivers\M\V\3\vminiide.inf
PCI\VEN_1106&DEV_3349&CC_0101=c:\drivers\M\V\3\vminiide.inf
PCI\VEN_1106&DEV_5287&CC_0101=c:\drivers\M\V\3\vminiide.inf
PCI\VEN_1106&DEV_3164&CC_0101=c:\drivers\M\V\3\vminiide.inf
PCI\VEN_1106&DEV_0581&CC_0101=c:\drivers\M\V\3\vminiide.inf
PCI\VEN_1106&DEV_5324&CC_0101=c:\drivers\M\V\3\vminiide.inf
PCI\VEN_104B&DEV_1040=c:\drivers\M\VM\vmscsi.inf
These are the drivers I loaded, including SATA drivers of nforece, intel, via, sis, ali, amd. If other drivers need to be loaded, you can refer to the DriverPack_MassStorage_wnt5_x86-32.ini file in the driver pack.
4. Create the i386\$oem$ directory under the c:\sysprep directory, and create the cmdlines.txt file in c:\sysprep\i386\$oem$, and add the following content in the file
"c:\sysprep\sysprep -clean"
In this way, all mass storage controllers that are not installed because they do not exist on the target computer will be disabled during the minimal installation process.
5. Finally, execute sysprep to encapsulate. During the encapsulation process, the system will automatically install the SRS drivers. During the minimal installation, the redundant drivers will be deleted.
The advantage of this is that you can control the loaded drivers according to your own needs, and the disadvantage is that it is more troublesome to add manually.
Original post address of the quoted article http://bbs.mscode.cc/thread-51438-1-2.html
[ Last edited by baikaifang on 2007-6-3 at 08:04 PM ]
