' Perform an FTP call in BASIC INPUT "Host name"; h$ INPUT "User name"; u$ PRINT "Password"; COLOR 0, 0 ' use hidden input INPUT p$ COLOR 7, 0 INPUT "Local directory"; ld$ INPUT "Remote directory"; rd$ INPUT "Remote file name"; rf$ ' Create a *unique* temporary file name, so this program can ' simultaneously run multiple times without conflicts tp$ = ENVIRON$("TEMP") IF tp$ = "" THEN PRINT "Make sure that your TEMP environment variable has been" PRINT "set. Add a line SET TEMP=C:\TEMP to your AUTOEXEC.BAT" SYSTEM END IF IF RIGHT$(tp$, 1) <> "\" THEN tp$ = tp$ + "\" END IF tp$ = tp$ + "~" FOR I% = 1 TO 3 tp$ = tp$ + CHR$(65 + CINT(INT(26! * RND))) NEXT I% tp$ = tp$ + MID$(TIME$, 4, 2) + RIGHT$(TIME$, 2) + ".TMP" ' create a file with FTP commands OPEN tp$ FOR OUTPUT AS 1 PRINT #1, "user "; u$; " "; p$ PRINT #1, "bin" PRINT #1, "cd "; rd$ PRINT #1, "lcd "; ld$ PRINT #1, "get "; rf$ PRINT #1, "bye" CLOSE 1 ' Execute FTP command: This works like in UNIX and Linux :-) SHELL "ftp -n " + h$ + " <" + tp$ ' delete temporary file KILL tp$ END