Script help please

Advertisement

Imryint
Guest

Script help please

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.

Reply with quote

Advertisement

Imtryin
Guest

Script help

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

Reply with quote

Vasu
Guest

Here is the script you need to write

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

Reply with quote

Advertisement

You can post new topics in this forum