Re: How to download to new folder
WinSCP script cannot create local folders. You have to create the folder in the batch file, before you start WinSCP. But you can use WinSCP
See Formatting Timestamp in Batch File.
So something like this:
%TIMESTAMP%
syntax to generate the folder name.
See Formatting Timestamp in Batch File.
So something like this:
set TIMESTAMP_FORMAT=yyyy-mm-dd
for /F "tokens=* USEBACKQ" %%F in (
`winscp.com /command "echo %%TIMESTAMP#%TIMESTAMP_FORMAT%%%" "exit"`
) do set TIMESTAMP=%%F
set TARGET_PATH=C:\Users\Data\%TIMESTAMP%
mkdir %TARGET_PATH%
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
...
/command ^
...
"lcd ""%TARGET_PATH%""" ^
...