批处理 bat变量重新赋值

@echo off
call Signature.exe "C:\Test.dll"
SETLOCAL ENABLEDELAYEDEXPANSION
set "nResult="
if %errorlevel% == 1024 (
	set "nResult=1024"
) else (
	set "nResult=2048"
)
@echo %nResult%
pause

变量要加双引号就解决了问题

猜你喜欢

转载自blog.csdn.net/what951006/article/details/82842928