Script to upload files without the associated subfolders

Advertisement

ghair357
Joined:
Posts:
1

Script to upload files without the associated subfolders

I want to upload all files contained within the subfolders (C:\Subintest\112233 and C:\Subintest\445566), but I don't want to upload the actual subfolders. I tested the following for .jpg's, but the subfolders also uploaded:
lcd C:\Subintest\
cd /Gerald
put * -filemask=*.jpg -resumesupport=on *
exit

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,378
Location:
Prague, Czechia

Re: Script to upload files without the associated subfolders

There's no simple solution for this.
If you have only two folders, why doesn't upload the contained files individually?
put 112233\*.jpg -resumesupport=on
put 445566\*.jpg -resumesupport=on

If you actually have many folders, you need way more complicated script.

One way would be to enumerate the folder in a batch file and generate WinSCP script with one put command for each folder.

Or use a script like this (which is for download):
https://winscp.net/eng/docs/script_download_files_to_same_folder
Similar question: https://winscp.net/forum/viewtopic.php?t=26674

Reply with quote

Advertisement

You can post new topics in this forum