I'm trying to make it so when the script is first ran it checks if there is a file, if there isn't then this is the first time the script has been run and it should run some code else it is been run more then once and should execute other code. Every time I run the file cmd crashes.
This is my file
@echo off
cd src/ops
IF EXIST setupdone.txt (
set /p setting=Do you want to run the server or change your settings?:
echo "1 - Run Server"
echo "2 - Change Settings"
IF %setting% == "1" (
echo it is 1
) ELSE (
IF %setting% == "2" (
echo it is 2
) ELSE (
echo Invalid Input! Rerun this file to try again.
)
)
) ELSE (
cd src/server
echo Installing Modules...
call npm install
cd ../settings
call npm install
cd %~dp0
cd src/ops
echo setupdone>setupdone.txt
cd %~dp0
)
echo done
pause