|
#1
|
|||
|
|||
|
I am trying to write a batch file, which will load a session and produce a difference report between to directories.
This batch file, will use an infile and the /silent option Please can someone just clarify the DOS Error handling for me as I can get an errorlevel "9009" if I have an unknown command in the infile, however when I create a "Fatal Scripting Error: Unable to load base folder" error - the DOS Errorlevel is "0". The reason I need to confirm the successfull completion is so that I can automate the task using a scheduler tool and want additional actions to be performed based on the completion status. Any assistance would be greatly appriciated - thanks |
|
#2
|
|||
|
|||
|
You can check the %errorlevel% variable in a batch file (command script):
if %errorlevel%==9009 goto...
__________________
BC build 3.2.00.12469 (beta) ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ |
|
#3
|
|||
|
|||
|
Thanks Michael, but what about the "Fatal Scripting Error: Unable to load base folder", as this returns a DOS Errorlevel of 0, however the script has failed.
The only other way I can think of is to include a script, which searches the log file for "Fatal Scripting Error" and returns a Errorlevel of 1, however this seams a bit long winded. Does BComp.exe not return DOS error codes for fatal error?? |
|
#4
|
|||
|
|||
|
Sorry, I guess I missed the crux of your question. Scooter will need to address the error level 0 on a "Fatal Scripting Error". According to the help file, the following DOS Error Levels are set on exit:
0 - Success 1 - Binary Match 2 - Rules-Based Match 11 - Binary Difference 12 - Similar 13 - Rules-Based Difference 14 - Conflicts Detected 100 - Unknown error 101 - Conflicts Detected. Merge output not written. I would think that failure to load a file or folder could generate its own errorlevel or, if nothing else, an errorlevel 100.
__________________
BC build 3.2.00.12469 (beta) ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ |
|
#5
|
|||
|
|||
|
Thanks, Michael. The Error Code section in the Help File actually refers to using the /qc or Quick Compare arguements. We do not set error codes for scripting (neither did BC2).
We're currently working on other projects/issues, but this sounds like a good idea. I'll make a tracker entry for this feature.
__________________
Aaron P Scooter Software |
|
#6
|
|||
|
|||
|
Thanks Aaron / Michael for your help in this matter.
|
|
#7
|
|||
|
|||
|
Hi Aaron
Any news on when DOS batchmode error handling will be added to BC3?? Thanks |
|
#8
|
|||
|
|||
|
It is currently an open entry. It is something we would like to do in a future release, but is not scheduled development.
__________________
Aaron P Scooter Software |
|
#9
|
|||
|
|||
|
Also, it would be nice if we could get a return code from the command line regardless if we call a script or a normal session.
|
|
#10
|
|||
|
|||
|
The next release will have this fixed. The scripting engine will now return the following exit codes:
0: Script successful (no fatal errors). May include non-fatal errors (eg, access denied during a copy) 100: Unknown error 105: Unable to load script file 106: Syntax error 107: Unable to load base folder (also includes paths from a FILE-REPORT command)
__________________
Craig P Scooter Software |
![]() |
| Thread Tools | |
| Display Modes | |
|
|