Thanks martin! I will do that instead
- res74
get -delete
:
get *
and then rm *
but because there is a gap in time between those 2 commands, it's deleting files that are not processed already. Basically we connect to an SFTP server and just get the files on there and remove them once we have them. I have this in batch file currently and looking for some help. What I have so far:
@echo off
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/log="C:\scripts\FTPScripts\microProd.log" /logsize=10*10M /ini=nul ^
/command ^
"open sftp://thesite""" ^
"lcd \\perseus\micro\active" ^
"cd \" ^
"get *" ^
"rm *" ^
"exit"
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
echo Success
) else (
echo Error
)
exit /b %WINSCP_RESULT%