WINSCP script halt on no errors
Hi all,
apologies if this has been covered a million times before (believe me I feel like I have read every post)
I have a script to download files via FTP to a local drive, it works up to the point where I get a permission error where it requires user input at which point it just stops. I have read you can over write this using the 'option batch continue' command however the script doesnt seem to recognise this as a command and I get 'option is not recognised as an internal or external command'
I have put the option command both before and after the WinSCP line in and out of quotes but get the same result.
below is my script:
@ECHO OFF
set TIMESTAMP_FORMAT=yyyy-mm-dd
cd "C:\Program Files (x86)\WinSCP"
for /F "tokens=* USEBACKQ" %%F in (`WinSCP.com /command "echo %%TIMESTAMP#%TIMESTAMP_FORMAT%%%" "exit"`) do set TIMESTAMP=%%F
set mydir=E:\folder\anotherfolder - Backups\%TIMESTAMP%
mkdir "%mydir%"
WinSCP.com /command ^
"option batch continue" ^
"open ftp://websiteftp:!password@somewebsite.co.uk" ^
"lcd ""%mydir%""" ^
"get *.*" ^
"exit"
pause
could anyone advise? I have seen example scripts where its not in quotes and just at the top of the script
Thanks
apologies if this has been covered a million times before (believe me I feel like I have read every post)
I have a script to download files via FTP to a local drive, it works up to the point where I get a permission error where it requires user input at which point it just stops. I have read you can over write this using the 'option batch continue' command however the script doesnt seem to recognise this as a command and I get 'option is not recognised as an internal or external command'
I have put the option command both before and after the WinSCP line in and out of quotes but get the same result.
below is my script:
@ECHO OFF
set TIMESTAMP_FORMAT=yyyy-mm-dd
cd "C:\Program Files (x86)\WinSCP"
for /F "tokens=* USEBACKQ" %%F in (`WinSCP.com /command "echo %%TIMESTAMP#%TIMESTAMP_FORMAT%%%" "exit"`) do set TIMESTAMP=%%F
set mydir=E:\folder\anotherfolder - Backups\%TIMESTAMP%
mkdir "%mydir%"
WinSCP.com /command ^
"option batch continue" ^
"open ftp://websiteftp:!password@somewebsite.co.uk" ^
"lcd ""%mydir%""" ^
"get *.*" ^
"exit"
pause
could anyone advise? I have seen example scripts where its not in quotes and just at the top of the script
Thanks