参考:批处理中setlocal enabledelayedexpansion的作用详细整理 https://www.jb51.net/article/29323.htm
gnb项目的windows启动(涉及cmd中的延迟变量原理):.shgnb_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 ..inWindow10_x86_64gnb_es.exe -s -b ..conf!nodeid!gnb.map --dump-address --upnp
rem ..inWindow10_x86_64gnb.exe -i WindowsTun -c ..conf!nodeid!
rem 手动运行
rem start ..inWindow10_x86_64gnb_es.exe -d -q -s -b ..conf1445gnb.map --upnp
rem ..inWindow10_x86_64gnb.exe --daemon -i WindowsTun -c ..conf1445
start ..inWindow10_x86_64gnb_es.exe -d -q -s -b ..conf!nodeid!gnb.map --upnp
..inWindow10_x86_64gnb.exe --daemon -i WindowsTun -c ..conf!nodeid!
手动运行
:FINISH