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