I am attempting to make a script that is called from another script to update him...
This script is downloaded from a server via wget and it is started by other script. It checks version of RunToolkit and, if it isn't v1.1, it downloads the new version...
But when this script is called, it give an error, "unexpected goto".
Hers is the script:
@echo off
echo Latest version is 1.1
:restart
IF EXIST RunToolkit.exe (
FIND /I "1.1" "RunToolkit.exe" > NUL:
IF ERRORLEVEL 0 (
ECHO Your toolkit version is 1.1
echo No updates available!
PAUSE
goto quit
) ELSE (
ECHO Your toolkit is outdated, do you want to update it?
ECHO.
ECHO 1. Yes
ECHO 2. No
ECHO.
SET /P menunr=Select number you want :
IF %menunr%==1 (goto yesupdate)
IF %menunr%==2 (goto quit)
goto what
)
)
:yesupdate
echo Downloading new version!
wget (link deleted for privacy :P)
:what
echo.
echo You entered a wrong number! Retry!
PAUSE
goto restart
:quit
call RunToolkit.exe
Can anyone find the error, please?