我正在嘗試編寫一個批處理文件,該文件在找到文本字符串時會創建一個事件,如果找不到字符串,則會創建另一個事件。我至今是:根據找到的文本創建事件的批處理文件
rem ***************************************************************************************************************************************************************
rem * If the log file contains the 'copied' word log an event
rem ***************************************************************************************************************************************************************
find /c "copied" C:\Richards Folders\backup service\create events and logs\test backup log\backup.log
if errorlevel 1 goto ONE
if errorlevel 0 goto ZERO
:ZERO
eventcreate /L Application /T Information /SO "BackUp Service" /ID 900 /D "Copied in backing up files to the back-up store. For more details look in C:\Richards Folders\backup service\create events and logs\test backup log."
goto END
:ONE
eventcreate /L Application /T Error /SO "BackUp Service" /ID 901 /D "Error in backing up files to the back-up store. For more details look in C:\Richards Folders\backup service\create events and logs\test backup log."
:END
顯然,我做錯了什麼,因爲它要麼始終報告成功,甚至當我告訴腳本尋找一個胡說八道的文本,或者當正確的文本存在時,它報告失敗。
我的代碼有什麼問題?