[an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] 24x7 Script Archive


Using FTP commands

Dim process_id, number
Dim found, boolean

// Watch for file on remote FTP site.
FTPFileExists( "ftp.microsoft.com", "", "", "disclaimer.txt", found )

// If the file found,
// continue processing, otherwise exit and wait for the next cycle
if (found, DOWNLOAD, END )

DOWNLOAD:
// Download the file from Microsoft FTP site
FTPGetFile( "ftp.microsoft.com", "", "", "disclaimer.txt", "c:\temp\disclaimer.txt" )
// Do something with the downloaded file, for example you can display
// it in the Notepad
Run( "notepad c:\temp\disclaimer.txt", "", process_id )

// Delete the file - in a real-world you most likely will do this
// FTPDeleteFile( "ftp.microsoft.com", "", "", "disclaimer.txt" )

END:
// Done