ftp automation

ScriptFTP

The professional tool to automate FTP, SFTP, FTPS and schedule FTP batch jobs

The forum is now read only. Please, go to the the main ScriptFTP website if you need help.
Need help writing a script? Have any question about ScriptFTP?
I am attempting to script a VPN connection prior to my FTP connection. I am able to use the EXEC command to pass all the parameters and my Cisco VPN starts up. I have to use some trickery with the program Push the Freakin Button to accept the VPN security agreement. After the connection is made the VPN software does not hand control back to ScriptFTP. The script just hangs on the EXEC line. Is there any way to put a timer in the command itself to force control back to ScriptFTP after 10 or 15 seconds? Or does anyone have experience with doing command line cisco VPNs that has any suggestions?

I first tried doing a fully command line implementation using vpnclient.exe but I don't know of a way to pass the neccessary y to the VPN to accept the security agreement so I switched over to doing vpngui.exe which pops up a windows box to accept the agreement. I am able to accept it using PTFB but I think that's why command does not go back to ScriptFTP it's a windows app and doesn't end like the command line version would.

Any and all suggestions gratefully accepted.
Rolard
Super late reply...but may be helpful for others. This is pretty sloppy if you ask me, but it works and i haven't found a better or more reliable way. This is for Cisco Systems VPN (not AnyConnect). It will stay within the Script FTP shell.

I have created two separate batch files to "connect.bat" and "disconnect.bat" and called them at the beginning and end of the scriptFTP code. I also could not get the connection name, username, and password parameters passed to Cisco any other way... but this works.

Create a batch file with the connection parameters (enter your Cisco VPN settings in place of the ALL CAPS below):
@echo off & setlocal
echo Opening VPN...
"C:\Program Files (x86)\Cisco Systems\VPN Client\vpnclient.exe" connect CONNECTIONNAME user USERNAME pwd PASSWORD
endlocal
Create a batch file with the disconnect parameters:
@echo off & setlocal
echo Disconnecting from VPN...
"C:\Program Files (x86)\Cisco Systems\VPN Client\vpnclient.exe" disconnect
endlocal
Put the batch files in the same folder with your ScriptFTP code... and call the connect.bat in the beginning and the disconnect.bat and the end of your scriptFTP code (call the correct file and folder, not where I have them):

[scriptftp="vpn"]PRINT("Connecting to VPN")
EXEC('D:\Scripts\connect.bat')
.....
PRINT("Disconnecting from VPN")
EXEC('D:\Scripts\disconnect.bat')[/ScriptFTP]
Thanks for sharing this with us, Jbuckmas