I’ve read a lot of batch file tutorials, but the explanations of return codes and parameters in batch files are never very detailed.
But if you want to make a fairly complete batch file, these two areas need to be used a lot.
For example, I want to use a CD to do automatic Ghost system recovery. I hope it can boot from the CD automatically and use the image file on the CD to overwrite drive C:.
The autoexec.bat file looks like this
MSCDEX.EXE /D:IDECE001 /L:Z
Ghost -clone,mode=load,src=z:\bac.gho,dst=1:1 -sure -rb
Now I want there to be a prompt after booting from the CD: if needed, press "1"; if not, press "2" to exit.
So I need a return code for the judgment.
How should autoexec.bat on the CD be set up?
And a lot of batch files use parameters, but there have never been very detailed tutorials on how parameters are used.
For example, the batch file below,
echo.
message /b 15 1 %msg%
echo *** %msg% ***>> c:\diag\proc.log
getrtime >> c:\diag\proc.log
How is %msg% used here? Could an expert give me some pointers?
I hope an expert can give a simple explanation of these two aspects. I would be extremely grateful.
But if you want to make a fairly complete batch file, these two areas need to be used a lot.
For example, I want to use a CD to do automatic Ghost system recovery. I hope it can boot from the CD automatically and use the image file on the CD to overwrite drive C:.
The autoexec.bat file looks like this
MSCDEX.EXE /D:IDECE001 /L:Z
Ghost -clone,mode=load,src=z:\bac.gho,dst=1:1 -sure -rb
Now I want there to be a prompt after booting from the CD: if needed, press "1"; if not, press "2" to exit.
So I need a return code for the judgment.
How should autoexec.bat on the CD be set up?
And a lot of batch files use parameters, but there have never been very detailed tutorials on how parameters are used.
For example, the batch file below,
echo.
message /b 15 1 %msg%
echo *** %msg% ***>> c:\diag\proc.log
getrtime >> c:\diag\proc.log
How is %msg% used here? Could an expert give me some pointers?
I hope an expert can give a simple explanation of these two aspects. I would be extremely grateful.
