Kbase P57000: How to get the return code from a dos command
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  1/9/2004 |
|
Status: Unverified
GOAL:
How to get the error return code from proutil on Windows
FACT(s) (Environment):
Windows 32 Intel
FIX:
For Batch Files on Windows you use the
ERRORLEVEL variable. Syntax:
IF ERRORLEVEL errorvalue do_something
example for test.bat:
@echo off
call _proutil sports -C truncate bi
if %ERRORLEVEL%==0 goto OK
echo The ERRORLEVEL = %ERRORLEVEL%
:OK
@echo on
gives the following results:
proenv>proserve sports
PROGRESS Version 9.1D07 as of Wed Sep 24 09:45:38 EDT 2003
11:57:45 BROKER : This broker will terminate when session ends. (5405)
11:57:45 BROKER 0: Multi-user session begin. (333)
proenv>test
** The database sports is in use in multi-user mode. (276)
The ERRORLEVEL = 2
proenv>proshut sports -by
PROGRESS Version 9.1D07 as of Wed Sep 24 09:45:38 EDT 2003
Shutdown is executing. (1613)
Shutdown complete. (1614)
proenv>test
proenv>