完美解决了:
- @echo off
- for /f "tokens=2 delims=&" %%a in ('findstr /i "audio" 1.txt') do @echo,%%a
- pause>nul 2>nul & exit
复制代码
======================================================================
::【获取声卡ID】- @echo off
- devcon find PCI\* >PCI设备-列表.txt
- for /f "tokens=2 delims=&" %%a in ('findstr /i "audio" PCI设备-列表.txt') do @echo,%%a>声卡ID.txt
- start "" 声卡ID.txt
- del PCI设备-列表.txt
- exit
复制代码 ======================================================================
::【获取网卡ID】- @echo off
- devcon find PCI\* >PCI设备-列表.txt
- for /f "tokens=2 delims=&" %%a in ('findstr /i "Realtek" PCI设备-列表.txt') do @echo,%%a>网卡ID.txt
- start "" 网卡ID.txt
- del PCI设备-列表.txt
- exit
复制代码
=====================================================
原来的问题:
怎样截取“含Audio的行中”第1个& 和 第2个&之间的字符(下面红色的)?谢谢
=========================================
文本形如:
PCI设备(列表).txt:
PCI\VEN_8086&DEV_1C2D&SUBSYS_1C2D8086&REV_05\3&11583659&0&D0: Intel(R) 6 Series/C200 Series Chipset Family USB Enhanced Host Controller - 1C2D
PCI\VEN_8086&DEV_0152&SUBSYS_21118086&REV_09\3&11583659&0&10: (VGA )
PCI\VEN_8086&DEV_0150&SUBSYS_01508086&REV_09\3&11583659&0&00: Memory Controller
PCI\VEN_8086&DEV_1C02&SUBSYS_1C028086&REV_05\3&11583659&0&FA: Standard SATA AHCI Controller
PCI\VEN_8086&DEV_1C5C&SUBSYS_1C5C8086&REV_05\3&11583659&0&F8: LPC Controller
PCI\VEN_8086&DEV_1C10&SUBSYS_1C108086&REV_B5\3&11583659&0&E0: PCI PCI
PCI\VEN_10EC&DEV_8168&SUBSYS_012310EC&REV_15\4&45F2A70&0&00E1: Realtek PCIe GBE Family Controller
PCI\VEN_8086&DEV_1C12&SUBSYS_1C128086&REV_B5\3&11583659&0&E1: PCI PCI
PCI\VEN_8086&DEV_1C18&SUBSYS_1C188086&REV_B5\3&11583659&0&E4: PCI PCI
PCI\VEN_10EC&DEV_C821&SUBSYS_C82110EC&REV_00\4&302BABE0&0&00E4:
PCI\VEN_8086&DEV_1C20&SUBSYS_1C208086&REV_05\3&11583659&0&D8: High Definition Audio Controller
PCI\VEN_8086&DEV_1C22&SUBSYS_1C228086&REV_05\3&11583659&0&FB: SM Bus Controller
PCI\VEN_8086&DEV_1C26&SUBSYS_1C268086&REV_05\3&11583659&0&E8: Intel(R) 6 Series/C200 Series Chipset Family USB Enhanced Host Controller - 1C26
13 matching device(s) found. |