我需要做一個腳本,在檔案中查找一些文本,并在 %userprofile% 路徑中查找檔案本身,它作業正常但是當我嘗試統一它時,而不是輸出 2 確認訊息只輸出 1 ,有些事情沒有按預期進行,這是代碼:
hostname > hstnm.txt
SET /p hstnm=<hstnm.txt
SET pccer=.filextension1
SET pcsip=.filextension2
SET fullhost=%hstnm%%pccer%
SET fullsip=%hstnm%%pcsip%
SET fullroute=%userprofile%\thepath\%fullhost%
SET siproute=%userprofile%\thepath\%fullsip%
FINDSTR /m "<Protocol>TLS</Protocol>" "%siproute%"
IF %errorlevel%==0 (
SET siptest="true"
) ELSE (
SET siptest="false"
)
IF EXIST "%fullroute%" (
SET certest="true"
) ELSE (
SET certest="false"
)
IF %siptest%=="true" &
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/428976.html
上一篇:根據文本檔案的輸出設定引數?
