The professional tool to automate FTP, SFTP, FTPS

and schedule FTP batch jobs

Need help writing a script? Have any question about ScriptFTP?

I use script FTP to download syslog data from firewall installations. Some sites have multi WAN connections, and currently, the system tries WAN1, then if it can't connect, WAN2, WAN3 and so and so forth.

I'd like to randomly pick the first WAN to try rather than always going for WAN1 all the time. I've tried all sorts of ways of getting a random number but with a defined maximum but can't seem to get any to work properly.

Closest I've gotten is by creating a small script that I can run, I.E - randomnumber.exe 10 successfully outputs a number into the console between 1 & 10, but I can't then get that into a variable for use in the script....?

Return the number not to the console, but as an exit code...
FTP Script
  1. $result=EX EC("randomnumber.exe 10")
Remove the space in the EX EC, the forum does not allow it to be written correctly, thinks it is an exploit :(

Done that and it works perfectly :)