Operagust
Operagust

Reputation: 45

Upload files and subfolders in defined order through SFTP using WinSCP (put command)

I have a folder (Source) that contains subfolders and XML files:

Source\
    Folder1\
    Folder2\
    Folder1.xml
    Folder2.xml

I need to transfer these subfolders and files through SFTP using WinSCP but my constraint is that I need to transfer the subfolders first and only at the end the remaining files.

I can use the put command, but it seems that if I use wildcard it copies everything.

I.e:

put \\Sharepath\Source\*

Using the Windows scripting it works fine, but it seems that I can't do the same thing using put command

I.e:

'Copy only folders
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFolder \\\SharePath\Source\*, \\\SharePath\Destination, True

'Copy only files
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFiles \\\SharePath\Source\*.xml, \\\SharePath\Destination\, True

Upvotes: 1

Views: 1020

Answers (1)

Martin Prikryl
Martin Prikryl

Reputation: 202197

Use WinSCP put command twice:

Upvotes: 1

Related Questions