2
需要協助找出一些命令/一個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,但我認爲我使用它錯了。