Sample Scripts (WS_FTP Professional)

Sample 1. A script that downloads a file (anonymous login)

In this example, the script connects to the Progress FTP site and downloads a "Read Me" file.

Type at Command Prompt:

C:/ftpscrpt -f getreadme.scp

getreadme.scp

TRACE SCREENLOG SCREENUSER anonymousPASS ipswitchuser@unknownCONNECT ftp.progress.comCD Progress\Product_DownloadsDIRGET readme.txtCLOSE

Sample 2. A script that uploads web pages to a hosted site (most parameters in script commands)

In this example, the script connects to a specific FTP site entering a user ID and password. Then the script changes (CD) to the appropriate folder on the FTP site and on the local system (LCD). Finally it copies all the .htm files in the current local folder to the current FTP folder.

Type at Command Prompt:

C:/ ftpscrpt -f postwebsite.scp

postwebsite.scp

TRACE Screen

LOG Screen

USER Louie

PASS Petra

CONNECT ftp.acme_isp.com

CD htmfiles/LouPetra

LCD C:/webstuff/current/

MPUT *.htm

CLOSE

Sample 3. A script that uploads web pages to a hosted site (most parameters in command line)

In this example, the command line and the script achieve exactly the same result as the previous script, but the parameters are entered in the command line instead of in the script.

Type at Command Prompt:

C:\ftpscrpt -p yourprofilename -f yourscriptname.scp

postwebsite.scp

TRACE Screen

LOG Screen

CONNECT

LCD C:/LPwebstuff/current

MPUT *.html

CLOSE

Sample 4. A script that uploads web pages to a hosted site, then moves the source files to a new folder (via the Post Transfer command)

In this example, the script connects to a specific FTP site entering a user ID and password. Then the script changes (CD) to the appropriate folder on the FTP site and on the local system (LCD). It then copies all the .htm files in the current local folder to the current FTP folder. Finally, after the transfer completes, the script moves the source files to an archive folder: C:/webstuff/archive/

Type at Command Prompt:

C:/ ftpscrpt -f postwebsite.scp

postwebsite.scp

TRACE Screen

LOG Screen

USER Louie

PASS Petra

CONNECT ftp.acme_isp.com

CD htmfiles/LouPetra

LCD C:/webstuff/current/

POSTXFER PXMOVE C:/webstuff/archive/

MPUT *.htm

POSTXFER PXOFF

CLOSE