Sample scripts are provided as-is with no warranty of fitness for a particular purpose. These scripts are solely intended to demonstrate techniques for accomplishing common tasks. Additional script logic and error-handling may need to be added to achieve the desired results in your specific environment.
download_file.s
This script generated by the Script File Wizard dials into a network dialup connection, logs on, and downloads a specific file.
1 ;; Robo-FTP Script File
2 ;; Created by Script File Wizard on Wednesday, July 19, 2000 at 14:14:19
3 ;;
4 ;; Notes: 1. Script commands always in all CAPS (e.g., SENDFILE)
5 ;; 2. Script labels are Capitalized (e.g., :Exit)
6 ;;
7 ;; Description: Download a file from ftp.robo-ftp.com
8 ;;
9 ;; Select the default folder containing files for this session
10 WORKINGDIR "C:\Program Files\Robo-FTP\"
11 :Top
12 ;; Define the number of times to try the DIALNET command
13 LOOPCOUNT 1
14 :DialLoop
15 ;; Connect to an FTP server using Dial-Up Networking
16 DIALNET "MyConnection" /timeout=60
17 ;; If the connect is successful, continue script processing
18 ;; from the Logon label
19 IFERROR= $ERROR_SUCCESS GOTO Logon
20 ;; Tried DIALNET once...
21 LOOPTO DialLoop
22 ;; Stop processing script and return to Robo-FTP user mode
23 STOP
24 :Logon
25 ;; Define the number of times to try the FTPLOGON command
26 LOOPCOUNT 1
27 :LogonLoop
28 FTPLOGON "ftp.robo-ftp.com" /timeout=60
29 ;; If the logon is successful, continue script from the Operation1 label
30 IFERROR= $ERROR_SUCCESS GOTO Operation1
31 ;; Tried FTPLOGON once...
32 LOOPTO LogonLoop
33 ;; Stop processing script and return to Robo-FTP user mode
34 STOP
35 :Operation1
36 ;; Define the number of times to try the FTPCMD command
37 LOOPCOUNT 1
38 :CommandLoop1
39 ;; Send a FTPcommand to the server
40 FTPCMD "CWD robo-ftp/outgoing"
41 ;; Insert any additional commands here that may be necessary
42 ;; to handle server
43 ;; response(s) to the command
44 ;; ...
45 ;; If the FTP command is successful, continue script from the
46 ;; Operation2 label
47 IFERROR= $ERROR_SUCCESS GOTO Operation2
48 ;; Tried FTPCMD once...
49 LOOPTO CommandLoop1
50 ;; continue script processing from the Disconnect label
51 GOTO Disconnect
52 :Operation2
53 ;; Define the number of times to try the RCVFILE command
54 LOOPCOUNT 1
55 :FileLoop1
56 ;; Retrieve a file from an FTP server
57 RCVFILE "xmtfile1" /timeout=60
58 ;; If the receive file is successful, continue script from
59 ;; the Disconnect label
60 IFERROR= $ERROR_SUCCESS GOTO Disconnect
61 ;; Tried RCVFILE once...
62 LOOPTO FileLoop1
63 :Disconnect
64 ;; Disconnect from FTP server
65 FTPLOGOFF
66 ;; Hang-up the phone
67 DISCONNECT
68 :Exit
69 ;; Exit from Robo-FTP
70 EXIT

