Question: if I execute a command, how is the error return code after IF ERRORLEVEL defined??
For example: after GHOST fails to restore my system, I want it to display an error message, and after a successful restore, display a success message. How should I set it up??
:RESTORE
CHOICE /C:YN /T:N,10 CAUTION:All data on disk C will be lost,are you sure
IF ERRORLEVEL 2 GOTO QUIT
LH SMARTDRV.EXE 4096
@echo Please waiting....
GHOST -clone,mode=pload,src=F:\WIN98BAK.GHO:1,dst=1:1 -sure
IF ERRORLEVEL ? ECHO Restore system failure! GOTO QUIT
@echo Your system is restored successfully.
@echo Please remove the floppy diskette and reboot your computer!
GOTO QUIT
For example: after GHOST fails to restore my system, I want it to display an error message, and after a successful restore, display a success message. How should I set it up??
:RESTORE
CHOICE /C:YN /T:N,10 CAUTION:All data on disk C will be lost,are you sure
IF ERRORLEVEL 2 GOTO QUIT
LH SMARTDRV.EXE 4096
@echo Please waiting....
GHOST -clone,mode=pload,src=F:\WIN98BAK.GHO:1,dst=1:1 -sure
IF ERRORLEVEL ? ECHO Restore system failure! GOTO QUIT
@echo Your system is restored successfully.
@echo Please remove the floppy diskette and reboot your computer!
GOTO QUIT

