cmd 批处理中setlocal enabledelayedexpansion的作用详细整理
参考:批处理中setlocal enabledelayedexpansion的作用详细整理 https://www.jb51.net/article/29323.htm
gnb项目的windows启动(涉及cmd中的延迟变量原理):.\sh\gnb_windows.cmd 1445
@echo off
setlocal enabledelayedexpansion
cd /d %~dp0
set nodeid=%1
if defined nodeid (
echo nodeid is !nodeid!
) else (
echo nodeid is NULL
goto FINISH
)
rem start ..\bin\Window10_x86_64\gnb_es.exe -s -b ..\conf\!nodeid!\gnb.map --dump-address --upnp
rem ..\bin\Window10_x86_64\gnb.exe -i WindowsTun -c ..\conf\!nodeid!
rem 手动运行
rem start ..\bin\Window10_x86_64\gnb_es.exe -d -q -s -b ..\conf\1445\gnb.map --upnp
rem ..\bin\Window10_x86_64\gnb.exe --daemon -i WindowsTun -c ..\conf\1445
start ..\bin\Window10_x86_64\gnb_es.exe -d -q -s -b ..\conf\!nodeid!\gnb.map --upnp
..\bin\Window10_x86_64\gnb.exe --daemon -i WindowsTun -c ..\conf\!nodeid!
手动运行
:FINISH