enter image description here我爲我的項目編寫了批處理腳本,因爲路徑中包含空格,它不起作用。 能否請你幫我批處理腳本的文件路徑中的空間
@ECHO OFF
REM The below command will look for the size of file on the server and inform the user if scheduler is down.
setlocal
set nl=^& echo.
set file="C:\Program Files (x86)\Common Files\Zoom\Support\CptControl.exe"
set maxbytesize=0
FOR /F "usebackq" %%A IN ('%file%') DO set size=%%~zA
if %size% EQU %maxbytesize% (echo WARNING !!! %nl%Scheduler File is ^= %maxbytesize% bytes%nl%Please do not process invoices, contact Webcenter Support) else (echo Scheduler File OK)
PAUSE
它沒有爲我工作用它在下面,有沒有它是文件路徑中的任何其他的解決辦法有空間 – suvarna
@ suvarna,對不起,但是,沒有工作'是什麼意思? **如何**不起作用?觀察到的行爲是什麼?它與預期的行爲有什麼不同? –
理想情況下,它必須讀取文件大小,並且必須與邏輯中提供的大小進行比較,如果我的文件路徑沒有空格,則我在腳本中提供的邏輯正在工作。 – suvarna