代码怪 会编程,懂技术,爱科学,更会分享
批处理 bat变量重新赋值
发布于: 2021-01-23 更新于: 2025-02-26
1
2
3
4
5
6
7
8
9
10
11
@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

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

--- 本文结束 The End ---