Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.msdos.batch    |    Fun with MS-DOS batch files    |    42,547 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 40,580 of 42,547    |
|    foxidrive to Graham Hobbs    |
|    Re: getting a CMD retcode back to a REXX    |
|    20 Nov 12 17:34:52    |
      From: not@this.address.invalid              On 20/11/2012 13:45, Graham Hobbs wrote:       > Uli, Jeremy,       > didn't work, am cross posting to alt.msdos.batch       >       > My ooRexx atest.rex calls Windows XP youtry.cmd. The cmd may fail and       > I need to return a 'code' to the rexx. Am not having success.       >       > This is my rexx that runs youtry4:       > /* rexx */       > 'youtry4'       > say 'rc='rc       > exit       >       > This is my youtry4.cmd:       > @echo off       > echo am in youtry4       > set errorflag=0       > echo %errorflag%       > rem do stuff maybe reset errorflag e.g:       > set errorflag=4       > echo %errorflag%       > if %errorflag% GTR 0 EXIT /B 7       > echo leaving youtry4       >       > .. when rexx was run results were:       > C:\Analysis>atest.rex       > am in youtry4       > 0       > 4       > rc=0       > C:\Analysis>       >       > .. suggesting that EXIT /B 7 forces the exit but doesn't return a 7 in       > rc       >       > Please, thanks       > Graham Hobbs       >              It would seem that rc isn't evaluating the errorlevel.              One way around this is to have the batch file echo the errorlevel to a text       file and have rexx read the       text file.                     --       foxi              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca