Topic "Script help please"

Author Message
Imryint

Guest


hi,

this is a basic overview of what im trying to acheive. I have automated encyption program, any encrypted files will be dropped into "encrypted files" folder automaticaly, what i need is a script that will run every 3 - 5 minuts to scan this folder and check for any contents, if so, then winscp will FTP them over

This is the script i intend to use, but i am really struggling with the winSCP command line could you please help with the command?

going from local computer C:\encryptedfiles to /fromlee

I would like to if possible when the files have been FTP'd to close the connection.

Can you help me with this please, for some reason i cannot get my head round the WinSCP commands.
Advertisements
Imtryin

Guest


sorry i forgot to post my script...............here goes...

SETLOCAL
PATH=C:\program files (x86)\winscp;%PATH%
>"%TMP%\~ftp_list.txt" DIR /B "C:\encryptedfiles"
PUSHD "C:\encryptedfiles"
FOR /F "delims=" %%F IN ('MORE ^< "%TMP%\~ftp_list.txt"') DO (
IF EXIST %%F (
My winscp command goes here?????????????????????????????????????????????????
IF ERRORLEVEL == 0 DEL "%%F"
)
)
POPD
DEL "%TMP%\~ftp_list.txt"
ENDLOCAL
Vasu

Guest


Since you feel rest of your script is all done, here is the FTP command related code:

%WinScpDirectory%\WinSCP.com /script="ftp.txt" /log="FtpLog.log"



put the following code in ftp.txt file and place the file in the same folder as your script file (or where ever you want to, but keep the path if you choose to have it in a different folder)

option echo on
option batch on
option confirm off
open username:password@yourhost.com -hostkey="ssh-rsa 1024 11:22:33:44:55:66:77:88:99:11:22:33:44:55:66"
cd /fromlee
put C:\encryptedfiles\*.*
close
exit
Imtryin

Guest


Thanks,

using putty now instead which is up and running.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License