批处理 选择菜单 if goto 执行问题
批处理文件内部代码:cls@ECHOOFFsetlocalenabledelayedexpansionCLScolor0a:MENUECHO1.1G大包2.641M大包3...
批处理文件内部代码:
cls
@ECHO OFF
setlocal enabledelayedexpansion
CLS
color 0a
:MENU
ECHO 1.1G大包 2.641M大包 3.340M大包
echo 请输入选择项目的序号:
set /p DX=
if %DX%=="1" goto ID1
if %DX%=="2" goto ID2
:ID1
for /f "eol=D delims=" %%i in (3DMGAME.ini) do >>g.ini echo %%i
set a=0
for %%x in (351850,352150,358140,358141,358142,358143,358144) do (
set /a a+=1
set /a x=%%x
>>g.ini echo DLC00!a!=!x!
)
del 3DMGAME.ini
ren g.ini 3DMGAME.ini
:ID2
for /f "eol=D delims=" %%i in (3DMGAME.ini) do >>g.ini echo %%i
set a=0
for %%x in (352150,358140,358141,358142,358143,520520,520521) do (
set /a a+=1
set x=%%x
>>g.ini echo DLC00!a!=!x!
)
del 3DMGAME.ini
ren g.ini 3DMGAME.ini
start .\game.lnk
执行批处理文件,输入1,结果3DMGAME.ini文件尾部内容改为为:然后启动game
DLC001=352150
DLC002=358140
DLC003=358141
DLC004=358142
DLC005=358143
DLC006=520520
DLC007=520521
为什么不是按照我输入的数字进行修改啊? 展开
cls
@ECHO OFF
setlocal enabledelayedexpansion
CLS
color 0a
:MENU
ECHO 1.1G大包 2.641M大包 3.340M大包
echo 请输入选择项目的序号:
set /p DX=
if %DX%=="1" goto ID1
if %DX%=="2" goto ID2
:ID1
for /f "eol=D delims=" %%i in (3DMGAME.ini) do >>g.ini echo %%i
set a=0
for %%x in (351850,352150,358140,358141,358142,358143,358144) do (
set /a a+=1
set /a x=%%x
>>g.ini echo DLC00!a!=!x!
)
del 3DMGAME.ini
ren g.ini 3DMGAME.ini
:ID2
for /f "eol=D delims=" %%i in (3DMGAME.ini) do >>g.ini echo %%i
set a=0
for %%x in (352150,358140,358141,358142,358143,520520,520521) do (
set /a a+=1
set x=%%x
>>g.ini echo DLC00!a!=!x!
)
del 3DMGAME.ini
ren g.ini 3DMGAME.ini
start .\game.lnk
执行批处理文件,输入1,结果3DMGAME.ini文件尾部内容改为为:然后启动game
DLC001=352150
DLC002=358140
DLC003=358141
DLC004=358142
DLC005=358143
DLC006=520520
DLC007=520521
为什么不是按照我输入的数字进行修改啊? 展开
1个回答
展开全部
@ECHO OFF
setlocal enabledelayedexpansion
CLS
color 0a
:MENU
ECHO 1.1G大包 2.641M大包 3.340M大包
echo 请输入选择项目的序号:
set /p DX=
if "%DX%"=="1" goto ID1
if "%DX%"=="2" goto ID2
if "%DX%"=="3" goto ID3
set DX=&goto MENU
:ID1
for /f "eol=D delims=" %%i in (3DMGAME.ini) do >>g.ini echo %%i
set a=0
for %%x in (351850,352150,358140,358141,358142,358143,358144) do (
set /a a+=1
set x=%%x
>>g.ini echo DLC00!a!=!x!
)
goto End
:ID2
for /f "eol=D delims=" %%i in (3DMGAME.ini) do >>g.ini echo %%i
set a=0
for %%x in (352150,358140,358141,358142,358143,520520,520521) do (
set /a a+=1
set x=%%x
>>g.ini echo DLC00!a!=!x!
)
goto End
:ID3
goto End
:End
del 3DMGAME.ini
ren g.ini 3DMGAME.ini
start .\game.lnk
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询