I want to check within my script if the system (Win 2000) is online (a VPN-Connection is established).
With rasphone it is easy to establish the VPN, I tried serveral things to verify if the system is online. None of same worked well.
Do you know a solution? I don't want to do this via screen-dumping and graphical analysis, if possible.
It seems if the VPN Connection is established there is no special window regarding the VPN-Connection.
Thank you for your idear
dose
How to check if the RAS-session is established?
Moderators: JRL, Dorian (MJT support)
Not much info there for someone trying to assist you. What have you tried?I tried serveral things to verify if the system is online. None of same worked well.
I don't do VPN so I have no way to check this. I would think that after your connection is established there are files available that do not exist on your client computer. You could put IfFileExists> in a loop and continue when the file is found.
Label>CheckConnection
IfFileExists>V:\VPNConnectionTest.txt,ConnectionMade
Wait>1
Goto>CheckConnection
Label>ConnectionMade
The Microsoft VPN Client is handled in windows like a usual Dial-In Connection (for exampel with pppoe, modem or isdn).
I'm sorry but there is no special file existing if the connection is established.
The only thing I recognized is, that if the connection is up the command-line programm "rasdial" shows:
Connected with
VPN-Connection-name
command successfull finished
or if not connected shows:
no connection
command successfull finished
But how can I handle this output from an execute-command?
greethings
dose
I'm sorry but there is no special file existing if the connection is established.
The only thing I recognized is, that if the connection is up the command-line programm "rasdial" shows:
Connected with
VPN-Connection-name
command successfull finished
or if not connected shows:
no connection
command successfull finished
But how can I handle this output from an execute-command?
greethings
dose
If this is a command line program, perhaps you can use the DOS screen text acquisition technique discussed in this thread then parse the results looking for "command successfull finished"
Just throwing out ideas here... anyone who has known solution feel free to join in.
Just throwing out ideas here... anyone who has known solution feel free to join in.
hey Dose,
try this, I use the output. If its more then 2 lines, there a connection.
Works for me!
let>RP_WINDOWMODE=0
DeleteFile>c:\rasdial.txt
Run Program>cmd /c rasdial >c:\rasdial.txt
wait>0.5
Let>k=1
Label>start
ReadLn>c:\rasdial.txt,k,line
If>line=##EOF##,finish
rem Message>line
Let>k=k+1
Goto>start
Label>finish
if>k>3
MessageModal>Connection established
endif
hopes this helps,
Djek
try this, I use the output. If its more then 2 lines, there a connection.
Works for me!
let>RP_WINDOWMODE=0
DeleteFile>c:\rasdial.txt
Run Program>cmd /c rasdial >c:\rasdial.txt
wait>0.5
Let>k=1
Label>start
ReadLn>c:\rasdial.txt,k,line
If>line=##EOF##,finish
rem Message>line
Let>k=k+1
Goto>start
Label>finish
if>k>3
MessageModal>Connection established
endif
hopes this helps,
Djek