How do I transfer (or synchronize) directory non-recursively?

Use file mask |*/ to exclude all (sub-)directories.


In scripting, use -filemask switch of respective command (get, put or synchronize) to set the file mask:

put -filemask="|*/" *

With WinSCP .NET Assembly, use TransferOptions.FileMask property to set the file mask:

TransferOptions transferOptions = new TransferOptions();
transferOptions.FileMask = "|*/";
session.PutFiles(@"d:\toupload\*", "/home/user/", false, transferOptions);

Last modified: by martin