我的批处理脚本需要帮助.它运行得很好,但是后来当我想要运行它时,不断重复我之前显示的结果.例如,我上周执行了一个程序,呼叫运行echo"程序在上周开始运行",当我今天试图通过echo"This is today"运行它.它运行并显示以前的结果"
PS代码现在完美运行.... @echo off
SETLOCAL ENABLEDELAYEDEXPANSION
set file="C:\compress.gdb"
if not exist %file% goto :EOF
FOR %%A IN (%file%) DO set size=%%~zA
>"%temp%\math.vbs" echo Set objArgs = WScript.Arguments: num = objArgs(0) : result = 0
>>"%temp%\math.vbs" echo if num ^> 1073741824 then result=1
>>"%temp%\math.vbs" echo if num ^> 6442450944 then result=2
>>"%temp%\math.vbs" echo Wscript.echo result
for /f %%a in ('cscript /nologo "%temp%\math.vbs" %size% ') do set z=%%a
del "%temp%\math.vbs"
:: z will be 2 if %size% greater than 6442450944 …Run Code Online (Sandbox Code Playgroud) batch-file ×1