Building a VPN connection and then...

  • Thread starter Thread starter alg
  • Start date Start date
A

alg

I need to automatically connect to a distant end, do some
file transfers between DE and Local, then break the VPN
connection.

Was thinking about using an old-fashioned "batch file",
but need to know how to make the VPN connection
unattended. After I've done my business, how do you
break this connection?

This scenario repeats every 4 hours.

Thank you for any and all words-of-wisdom.
 
You asked:

alg said:
I need to automatically connect to a distant end, do some
file transfers between DE and Local, then break the VPN
connection.

Was thinking about using an old-fashioned "batch file",
but need to know how to make the VPN connection
unattended. After I've done my business, how do you
break this connection?

This scenario repeats every 4 hours.

Thank you for any and all words-of-wisdom.

Answer:

There are two ways of doing this:

1. You can write a simple C program to do establish the connection to the
remote machine and in the program you can do the FTP and disconnect after
the required is done. There are Win32 APIs which allow you to do this.
RasDial is the API that can be used to dial a connection. RasHangup will
cause the connection to end. These APIs are a part of RasApi32 library.
Checkout
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rras/rras/rasdial.asp.

2. A simpler way would be to use the batch file approach you mentioned.
There is a command line tool called the RasDial.Exe which establishes the
connection. You can type RasDial.Exe /? to view the available command line
options. For disconnecting, simply give the "RasDial.Exe <Connectoid name>
/d". You can have your FTP transfers in between these two calls in the batch
file.

Hope this helps!
 
Thank you. I will look into this.
-----Original Message-----
You asked:



Answer:

There are two ways of doing this:

1. You can write a simple C program to do establish the connection to the
remote machine and in the program you can do the FTP and disconnect after
the required is done. There are Win32 APIs which allow you to do this.
RasDial is the API that can be used to dial a connection. RasHangup will
cause the connection to end. These APIs are a part of RasApi32 library.
Checkout
http://msdn.microsoft.com/library/default.asp? url=/library/en-us/rras/rras/rasdial.asp.

2. A simpler way would be to use the batch file approach you mentioned.
There is a command line tool called the RasDial.Exe which establishes the
connection. You can type RasDial.Exe /? to view the available command line
options. For disconnecting, simply give the "RasDial.Exe
/d". You can have your FTP transfers in between these two calls in the batch
file.

Hope this helps!

--
Regards,
Rama Krishna Prasad[MSFT]
--
This posting is provided "AS IS" with no warranties, and confers no rights.


.
 
Back
Top