Results 1 to 2 of 2
2002-05-03, 20:41 #1
- Join Date
- Jan 2001
- Cincinnati, Ohio, USA
- Thanked 0 Times in 0 Posts
Obtaining a RASDIAL.EXE Error State in a Script
Brownie points for anyone who can help me with a creative solution to this situation.
Situation: I am running the RASDIAL command from a command prompt, in a batch file. The workstation RASDIALs out to a client system, maps a temporary drive, and retrieves data, disconnecting the RAS connection upon completion. So far so good.
Problem: There is another process running on the same workstation that also uses RASDIAL to initiate a connection. The problem occurs when that process is in use - when the BAT file attempts to RASDIAL and the modem is in use, it returns an error:
Remote Access error 797 - The connection failed because the modem (or other connecting device) was not found. Please make sure that the modem or other connecting device is installed.
Well, that's fine, but the modem IS there. The error is meaningless, because BAT files are stupid - they just march along and do whatever they do unless you build the logic in to trap an error condition. Since RASDIAL does not appear to return an ERRORLEVEL or some other kind of error that I can trap from a command line, my process just marches along and produces one error after the other.
So here's the operative question: is there any way, using RASDIAL or RASPHONE, that I can trap this condition (the modem is in use)? If I can, I can write logic in that makes the process wait and try again after a specified time out. Right now, the solution is to just run the BAT file and exit when I know that the modem is open - which isn't going to be an option forever.
Ideas, ideas? This is the same across all NT platforms (NT4, 2000 and XP), so far as I can tell - they all do the same thing.-Mark
2002-05-04, 09:42 #2
Re: Obtaining a RASDIAL.EXE Error State in a Script<hr> my process just marches along and produces one error after the other.<hr>Can you trap one of the following errors to trigger your wait-and-redial option?
I'm afraid I can't find anything in any of my batch-resource links - the only things that consistently popped up was wre a reference to RasDial Pro and a pretty useless Q125393.Leif
On UK time