I just created a batch file under FreeDOS to automate a Ghost image creation.
But it has a strange behaviour: If you press a number, the errorlevel does not go to the right number.
So if I type nr. 1 it should make a ghost image on HD (:1) but instead it starts ghost (:7)
echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
echo º ***MAINMENU*** º
echo ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹
echo º 1. BACKUP ON HD º
echo º 2. BACKUP HD RESTORE º
echo º 3. BACKUP HD FILE CHECK º
echo º 4. BACKUP ON DVD º
echo º 5. BACKUP FROM DVD º
echo º 6. BACKUP DVD FILE CHECK º
echo º 7. START GHOST º
echo º 8. REBOOT º
echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
choice /C:12345678 /N Choose a option...
if errorlevel 8 goto exit
if errorlevel 7 goto 7
if errorlevel 6 goto 6
if errorlevel 5 goto 5
if errorlevel 4 goto 4
if errorlevel 3 goto 3
if errorlevel 2 goto 2
if errorlevel 1 goto 1
:7
echo Start ghost...
pause
Ghost.exe
goto start
:6
pause
SET TZ=GHO-01:00
echo BACKUP DVD FILE CHECK...
pause
echo
ghost.exe -CHKIMG,@CD-R1\windowsbackup.GHO
goto start
:5
SET TZ=GHO-01:00
echo BACKUP FROM DVD...
pause
ghost.exe -clone,mode=pload,src=@CD-R1:\windowsbackup.GHO:[1],dst=[2:4]
GOTO start
:4
SET TZ=GHO-01:00
echo BACKUP ON DVD...
pause
ghost.exe -clone,mode=pdump,src=[2:4],dst=@CD-R1\windowsbackup.gho -Z9 -auto
goto start
:3
SET TZ=GHO-01:00
echo BACKUP HD FILE CHECK ...
pause
ghost.exe -CHKIMG,[2:5]\windowsbackup.GHO -SURE
goto start
:2
SET TZ=GHO-01:00
echo BACKUP HD RESTORE ...
pause
ghost.exe -clone,mode=pload,src=[3.6]:\windowsbackup.GHO:[1],dst=[3:2]
GOTO start
:1
SET TZ=GHO-01:00
echo BACKUP ON HD...
pause
goto start
As you can see after pressing 1 it should go to 1 but instead it executes 7.
Even if I put errorlevel 1 all up it does not work.
Also not working is change the goto 1 to goto 7 for errorlevel 1 and cheange the :1 into :7.
If I type option 2, it should go 2 :2 but instead it goes to :6
I really have no clue what's going on here.
Searched at google but no really good answer.
Hope someone can help me out
