Re: Command line FTP help



OK here is the batch program:


@echo off
rem Version 1.0
rem
if (%1)==() GOTO NOPARAM1
if (%2)==() GOTO NOPARAM2

rem This part of the program encrypts the input file and produces an
encrypted output file

gpg --armor --output %2 --recipient XXXXXXXX --encrypt %1
if not errorlevel 1 goto FTP
echo ------------------------------------------------------------------- >>
C:\Gnupg\SecureFTP.log
date /t >> C:\Gnupg\SecureFTP.log
time /t >> C:\Gnupg\SecureFTP.log
echo An error occured whilst encrypting the file >> C:\Gnupg\SecureFTP.log
echo ------------------------------------------------------------------- >>
C:\Gnupg\SecureFTP.log

GOTO END

rem This part of the program transfers the encrypted file using FTP

:FTP
echo ------------------------------------------------------------------- >>
C:\Gnupg\SecureFTP.log
date /t >> C:\Gnupg\SecureFTP.log
time /t >> C:\Gnupg\SecureFTP.log
C:\Windows\system32\FTP.EXE -i -n -d -s:C:\Gnupg\FTP_Steps.txt >>
C:\Gnupg\SecureFTP.log
if not errorlevel 1 goto END
echo ------------------------------------------------------------------- >>
C:\Gnupg\SecureFTP.log
date /t >> C:\Gnupg\SecureFTP.log
time /t >> C:\Gnupg\SecureFTP.log
echo An error occured during the FTP transfer >> C:\Gnupg\SecureFTP.log
echo ------------------------------------------------------------------- >>
C:\Gnupg\SecureFTP.log

GOTO END

:NOPARAM1
echo ------------------------------------------------------------------- >>
C:\Gnupg\SecureFTP.log
date /t >> C:\Gnupg\SecureFTP.log
time /t >> C:\Gnupg\SecureFTP.log
echo The input (unencrypted) filename did not get parsed to the program >>
C:\Gnupg\SecureFTP.log
echo ------------------------------------------------------------------- >>
C:\Gnupg\SecureFTP.log

:NOPARAM2
echo ------------------------------------------------------------------- >>
C:\Gnupg\SecureFTP.log
date /t >> C:\Gnupg\SecureFTP.log
time /t >> C:\Gnupg\SecureFTP.log
echo The output (encrypted) filename did not get parsed to the program >>
C:\Gnupg\SecureFTP.log
echo ------------------------------------------------------------------- >>
C:\Gnupg\SecureFTP.log

:END


Here is the FTP_Steps file:

open xxx.yyyyyyy.co.uk
user username password
put %2
quit
.



Relevant Pages

  • Re: Command line FTP help
    ... rem Version 1.0 ... if ==GOTO NOPARAM1 ... echo An error occured whilst encrypting the file>> %log% ... > rem This part of the program encrypts the input file and produces an ...
    (microsoft.public.win2000.networking)
  • a turbo assembly language
    ... if not exist %1.m goto pst1_n_as2 ... echo Uso con la shell: ... int catstr ... õ2\nmov õ1, eax"); ...
    (alt.lang.asm)
  • Re: Question for ¬a/b
    ... if not exist %1.m goto pst1_n_as2 ... echo Uso con la shell: ... char* estrai ... int catstr ...
    (alt.lang.asm)
  • Re: robocopy validation
    ... Robocopy did not copy any files. ... if errorlevel 8 echo **FAILED COPIES** & goto end ...
    (microsoft.public.win2000.general)
  • Re: DDKBuild ISSUE with WINDDK...
    ... ERRORLEVEL 1 goto wrongplatform ... EQU dog goto:nt4ddkbuild ... rem @echo W2K or later system ... binaries ...
    (microsoft.public.win32.programmer.kernel)