echo off rem *--*--*--*--*--*--*--*--*--*--*--*--*--*--*--* rem *** FILE: rem *** ~matth3bishop/BatchScripts/putf.txt rem *** DESCRIPTION: rem *** This batch program automates the rem *** process of putting a file on to the rem *** Yahoo Geocities ftp server for the rem *** website at rem *** http://www.geocities.com/matth3wbishop rem *** The script puts the file(s) into the home rem *** directory and uses ascii-mode by default. rem *** The first parameter is the file to put rem *** onto the geocities server. rem *** Add the -a switch when behind a firewall rem *** and when your ftp program supports the -a rem *** or -passive (linux) switch rem *** PARAMETERS: rem *** 1st: the file to upload. This also allows rem *** the '*' wildcard character for all files rem *** to be uploaded. rem *** 2nd: is a subdirectory (e.g. BatchScripts, cv, Resumes, ...) rem *** Defaults to the root directory of the account. rem *** 3rd: allows the file to be uploaded rem *** in binary mode (eg MS Word Documents) rem *** EXAMPLES: rem *** Example 1: rem *** 'putf SomeTextFile.txt' puts the file named rem *** SomeTextFile.txt into the home directory of rem *** the 'matth3wbishop' geocities site rem *** The url of the file will be rem *** http://www.geocities.com/matth3wbishop/SomeTextFile.txt rem *** Example 2: rem *** 'putf index.html Resumes' uploads an html rem *** file into the Resumes subdirectory on the rem *** matth3wbishop geocities site. Its url will be rem *** http://www.geocities.com/matth3wbishop/Resumes/index.html rem *** or just rem *** http://www.geocities.com/matth3wbishop/Resumes rem *** Example 3: rem *** 'putf aLetter.doc cv -binary' rem *** uploads the Microsoft Word document aLetter.doc rem *** into the cv subdirectory on the matth3wbishop site rem *** using binary mode. -b and -bin are also rem *** acceptable aliases. rem *** NOTES: rem *** The file needs to be renamed to rem *** putf.bat for it to run under Windows/DOS rem *** All of these scripts could make use of the rem *** 'if (condition) goto labelName' construct. rem *** c) Under WinMe (Windows Millenium) the script does not cause rem *** the ftp program to quit automatically. This particularly rem *** effects the pushf script, since the script pauses in the rem *** middle of the script waiting for the first ftp programme to be rem *** manually quit by the user. rem *** d) The getAllGeo script is not putting anything into the rem *** BatchScripts directory. (10 Sept 2001) rem *** AUTHOR: rem *** m.j.bishop (matth3wbishop@yahoo.com) rem *** TESTING: rem *** Win95 Appears to work rem *--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--* set sFileName=%1 set sSubDirectory=%2 echo on if "%sFileName%"=="" goto endif2 @rem *** @rem *** create the ftp script file @rem *** echo user matth3wbishop bacibaci > ftpScript000.txt echo hash >> ftpScript000.txt echo ascii >> ftpScript000.txt echo prompt >> ftpScript000.txt @if not "%sSubDirectory%"=="" echo cd %2 >> ftpScript000.txt @if "%3"=="-b" echo binary >> ftpScript000.txt @if "%3"=="b" echo binary >> ftpScript000.txt @if "%3"=="-bin" echo binary >> ftpScript000.txt @if "%3"=="bin" echo binary >> ftpScript000.txt @if "%3"=="-binary" echo binary >> ftpScript000.txt @if "%3"=="binary" echo binary >> ftpScript000.txt if "%sFileName%"=="*" echo mput %1 >> ftpScript000.txt if not "%sFileName%"=="*" echo put %1 >> ftpScript000.txt @rem *** @rem *** Logon & transfer the file @rem *** ftp -n -s:ftpScript000.txt ftp.geocities.com @rem *** When behind a firewall use the following line @rem *** ftp -n -s:ftpScript000.txt -a ftp.geocities.com del ftpScript000.txt :endif2 @echo off if not "%sFileName%"=="" goto endif1 echo *--*--*--*--*--*--*--*--*--*--* echo Dear User, echo You did not specify any parameters echo for this batch script. This script echo uploads a file to the 'matth3wbishop' echo Geocities server which has a url of echo http://www.geocities.com/matth3wbishop/ echo. echo Usage: putf filename [subdirectory] [-binary] echo. echo Please see the comments in the batch echo file for more information echo about how to use this script echo *--*--*--*--*--*--*--*--*--*--* :endif1 @echo on :end