I have setup a custom batch file to install a game server. But the issue is that it closes when you would supply a response. It use multiple IF statements.
set /P input6=Would you like a custom loadout (Y/N):
if %input6%==Y (
echo ---------------------------
echo Default
echo Survival
echo PvP
echo ---------------------------
set /P input7=Which one:
if %input7%==Default (
perl db_utility.pl [] ["DZ_Patrol_Pack_EP1",[[],[]],[[],[]]]
goto package
)
if %input7%==Survival (
perl db_utility.pl [["ItemMap","ItemCompass","ItemMatchbox","FoodCanBakedBeans","ItemKnife","FoodCanBakedBeans"],["ItemTent","ItemBandage","ItemBandage"]] ["DZ_Patrol_Pack_EP1",[[],[]],[[],[]]]
goto package
)
if %input7%==PvP (
perl db_utility.pl [["Mk_48_DZ","NVGoggles","Binocular_Vector","M9SD","ItemGPS","ItemToolbox","ItemCompass","FoodCanBakedBeans","ItemMap","ItemWatch"],[["100Rnd_762x51_M240",47],"ItemPainkiller","ItemBandage","15Rnd_9x19_M9SD","100Rnd_762x51_M240","ItemBandage","ItemBandage","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","ItemMorphine"]] ["DZ_Backpack_EP1",[[],[]],[[],[]]]
goto package
)
)
When I ran your batch file, I got this error:
When I reduced the number of lines of script between the open and close parentheses, the script would work. So I think you need to restructure the batch file, and avoid the nested
ifstructure. Try something like this: