需要帮助找到一些用于 bat 文件的命令/工具以自动转换内容:
%PCI\VEN_1B21&DEV_0601.DeviceDesc%= asahci_Inst, PCI\VEN_1B21&DEV_0601
%PCI\VEN_1B21&DEV_0602.DeviceDesc%= asahci_Inst, PCI\VEN_1B21&DEV_0602
%PCI\VEN_1B21&DEV_0611.DeviceDesc%= asahci_Inst, PCI\VEN_1B21&DEV_0611
%PCI\VEN_1B21&DEV_0612.DeviceDesc%= asahci_Inst, PCI\VEN_1B21&DEV_0612
为此(清理):
VEN_1B21&DEV_0601
VEN_1B21&DEV_0602
VEN_1B21&DEV_0611
VEN_1B21&DEV_0612
为此(插入代码和下一行):
devcon find * | find /i "VEN_1B21&DEV_0601" >NUL
if /i %ERRORLEVEL% equ 0 set DEVICE=DETECTED
devcon find * | find /i "VEN_1B21&DEV_0602" >NUL
if /i %ERRORLEVEL% equ 0 set DEVICE=DETECTED
devcon find * | find /i "VEN_1B21&DEV_0611" >NUL
if /i %ERRORLEVEL% equ 0 set DEVICE=DETECTED
devcon find * | find /i "VEN_1B21&DEV_0612" >NUL
if /i %ERRORLEVEL% equ 0 set DEVICE=DETECTED
我已经尝试过各种工具,如 rxfind(零文档)和 sed,但我认为我用错了。