Blog du Tristank

So terrific that 3 of 4 readers rated it "soporific"

Blogs

PasteOff Upload Script

  • Comments 1
  • Likes

This is a sample script that's quite similar to the Upload.CMD I use with PasteOff (fixed the download links, by the way), to upload images to my blog site. 

Customize the variables at the top, and upload away...

As a note, it is really important not to have trailing spaces after the SET lines or after the Echo %VAR% lines - they'll break it, and you'll be wondering why...

---- Upload.CMD

@echo off
Echo Creating FTP Script
SET FTPHOST=ftp.example.com
SET FTPUSR=DOMAIN\USER
SET FTPPAS=password
SET FTPDIR=/BlogImages

echo %FTPUSR%> uploadfile.txt
echo %FTPPAS%>> uploadfile.txt
REM echo %FTPPAS%>> uploadfile.txt
echo CD %FTPDIR%>> uploadfile.txt
echo PUT %1>> uploadfile.txt
echo QUIT>> uploadfile.txt

Echo Performing FTP Upload
ftp -s:uploadfile.txt %FTPHOST% >> ftplog.txt

Echo Deleting Upload File
REM better to delete it than leaving more passwords lying around
Echo.>>ftplog.txt
Echo Deleting File >> ftplog.txt
Del uploadfile.txt >> ftplog.txt

Comments
  • Thank you for
    this great script!