put -delete \\myshare\fullpath1\*[.]* /fullpath2/

Advertisement

usa
Joined:
Posts:
8

put -delete \\myshare\fullpath1\*[.]* /fullpath2/

In a local directory named "\\myshare\fullpath1\", I've got:
1) A regular file named "test.txt".
2) A subridectory named "subdirectory".

put -delete \\myshare\fullpath1\*[.]* /fullpath2/
uploads nothing, but should upload "test.txt" only.

put -delete \\myshare\fullpath1\*.* /fullpath2/
uploads both the file and the directory, and this is the expected behaviour.

So, how do I upload files only?
It's OK to upload only files with extensions.

PS:
Windows 7 x64
WinSCP, Version 5.5.6 (Build 4746)
Runs from 64-bit cscript.exe, VBScript.

Reply with quote

Advertisement

usa

I am glad to surprise you :-)

Do you mean that in order to transfer all the files without directories I should transfer their parent directory non-recursively?

Reply with quote

Advertisement

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

Re: put -delete \\myshare\fullpath1\*[.]* /fullpath2/

I actually got completely confused. The dot has a special function in operation masks only, not in file masks and moreover this is a local file mask, which does not even support the set-syntax []. So WinSCP behaves as designed.

I have updated respective comment in put command documentation:
The Windows wildcard supports * and ? only. If you want to use a full syntax of file masks, use a -filemask switch.
https://winscp.net/eng/docs/scriptcommand_put#fn1

Reply with quote

Advertisement

You can post new topics in this forum