findstr -v "^#" oemconfig.template
再把空白行拿掉
findstr -v "^#" oemconfig.template | findstr -v "^#"
把結果存到oemconfig_remove_mark.temp
findstr -v "^#" oemconfig.template | findstr -v "^$" > oemconfig_remove_mark.temp
透過FOR把每一行印出來
FOR /F "delims=" %i in (oemconfig_remove_mark.temp) do echo %i
把文件中,若有符合H19_EFI_BOOT_BLOCK_SIGN_CHECK = NO
則把H19_EFI_BOOT_BLOCK_SIGN_CHECK = YES
印出來
findstr -v "^#" oemconfig_remove_mark.temp | findstr "^H19_EFI_BOOT_BLOCK_SIGN_CHECK *= *NO *" > NUL && echo H19_EFI_BOOT_BLOCK_SIGN_CHECK = YES
參考資料:
如何從 SQL 錯誤記錄檔或 DBCC 輸出中掃描出錯誤
FINDSTR進階用法
Batch files - FINDSTR