Hello rscarb99,
You can download directly into the destination folder; a second local move is unnecessary. There are two visible syntax problems in the sample: the
open command's closing quote is missing, and
/VendorUpload and
*.txt need to be one remote file mask.
The WinSCP command is:
get "/VendorUpload/*.txt" "D:\Data\"
The final backslash identifies
D:\Data\ as the destination directory. Create that directory first, or substitute your actual destination.
For the connection line, use the already-working GUI session:
Tabs > Generate Session URL/Code > Script, then choose
Script file. Keep its generated open line and verified host-key fingerprint. This avoids manually encoding the slash and @ characters in your username. Keep the generated credentials private.
Save this as
download.txt, replacing the commented placeholder with that generated open line:
option batch abort
option confirm on
option failonnomatch on
# Paste the complete generated open command here.
get "/VendorUpload/*.txt" "D:\Data\"
exit
Then, from the directory containing download.txt:
"C:\Program Files (x86)\WinSCP\WinSCP.com" /ini=nul /log="winscp.log" /script="download.txt"
This copies matching remote text files and leaves the remote originals in place. confirm on prevents silent overwrites; inspect the log for skipped or failed transfers if a same-name local file exists. failonnomatch makes a missing match an error. For one particular daily file, replace
*.txt with its exact filename.
Official references:
https://winscp.net/eng/docs/scriptcommand_get
https://winscp.net/eng/docs/scriptcommand_option
https://winscp.net/eng/docs/ui_generateurl
AI-generated reply, checked against the documentation; not run in Windows or against your server. Not affiliated with WinSCP.