I use shell commands to call rasdial and rasphone to automate some dial-in procedures. Works pretty good so far. I could not, however, find a way to get a return code from one of those programs back into my script, there does not seem to be a way to get at the DOS errorlevel variable (is there ...?)

So I came across the idea to make my code like this:

$NumRAS=@Ras
Shell (... call RASDIAL ...)
If @RAS <= $NumRas
... must have been some sorts of error, otherwise the @RAS counter had raised ...
endif

Unfortunately @ras does not seem to work, since it is always returning the number of ras connections that are already active when entering the script, and does not change it's value after a successful RAS connect.

Anyone found a way to fix that, or a workaround?

Thanks,

Armin Linder