jaapengel79
MIS
Hi,
First of all, I'm a scripting newbie. I'm currently busy building a script which is a part of an elaborate bare metal recovery procedure ..
Now, the problem I'm facing is as follows. I'll paste the script for all to see and maybe help me out..
Now, the thing is, the 'type' and findstr work great. No problems there. It finds the errors that may occur this way; but regardless if there *are* any errors or not, it will always move on to the error_exit routine.
Maybe I'm not too familiar with exit codes, but I have 2 assumptions:
1) Findstr runs perfectly well, it finds the file it should and compares it with the error log mentioned in the type command. Therefore it exits with errorcode 0.
2) I'm not using the errorlevels correctly and will therefore never find the right solution.. Google doesn't tell me much about exit codes, except on sites that I need to pay for to see the answer!
First of all, I'm a scripting newbie. I'm currently busy building a script which is a part of an elaborate bare metal recovery procedure ..
Now, the problem I'm facing is as follows. I'll paste the script for all to see and maybe help me out..
type %systemdrive%\Progra~1\Cristie\CBMR\Logfiles\ba_cbmr_1.err | findstr /g:%systemdrive%\Progra~1\Cristie\CBMR\errmsg.txt
if errorlevel = 0 goto error_exit
goto end_exit
Now, the thing is, the 'type' and findstr work great. No problems there. It finds the errors that may occur this way; but regardless if there *are* any errors or not, it will always move on to the error_exit routine.
Maybe I'm not too familiar with exit codes, but I have 2 assumptions:
1) Findstr runs perfectly well, it finds the file it should and compares it with the error log mentioned in the type command. Therefore it exits with errorcode 0.
2) I'm not using the errorlevels correctly and will therefore never find the right solution.. Google doesn't tell me much about exit codes, except on sites that I need to pay for to see the answer!