Re: Command line FTP help
- From: "Jake" <Jake@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 12 Dec 2005 04:00:02 -0800
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
.
- Follow-Ups:
- Re: Command line FTP help
- From: Michael Bednarek
- Re: Command line FTP help
- From: Pegasus \(MVP\)
- Re: Command line FTP help
- References:
- Re: Command line FTP help
- From: Pegasus \(MVP\)
- Re: Command line FTP help
- Prev by Date: Re: Command line FTP help
- Next by Date: Any guys who have worked on SMS 2003
- Previous by thread: Re: Command line FTP help
- Next by thread: Re: Command line FTP help
- Index(es):
Relevant Pages
|