Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Help please wrote:

Okay i have figured it out ! but when It copys the files it also copies the folders along with the files. Is there anyway I could just get the files, instead of the files in subfolders?

-filemask=AAA.txt*|*/

See https://winscp.net/eng/docs/faq_script_non_recursive
Help please

Okay i have figured it out ! but when It copys the files it also copies the folders along with the files. Is there anyway I could just get the files, instead of the files in subfolders? here is my current code
"C:\Program Files (x86)\WinSCP\WinSCP.com" /command ^
"option batch abort" ^
"option confirm off" ^
"open sftp://Username:Password@server.com/" ^
"lcd C:\Users\Documents\filetransfer\ ^
"get -filemask=AAA.txt* /app/manager/loading/"^
"exit"


thanks once again
help please

When entered the code with corrected
AAA*

I recieve an error saying
Can't get attributed of file 'C:\Users\Documents\filetransfer\'.
No such file or directory.
error code: 2
error message from server: No such file

It seems like it is trying to get the file of C:\Users\Documents\filetransfer\ instead of using that folder as teh destination to transfer all the files name "AAA". Do you know what is wrong ? Sorry i will donate also :D
martin

It will search all subfolders.
Help please

Okay thank you, would that still search all the sub folders in the folder "loading" ? Or would I have to add a certain syntax so it searches all the subfolders inside the folder "loading"
martin

Re: Filemask errror

start with AAA

That would be AAA*, not *AAA.
Help please

Filemask errror

Hello I am trying to write a automatic script to open a server and find all the file names that start with AAA within a folder(called "loading" that has over 100 subfolders that start from "load 1" to "load 100"). I am trying to use the filemask option to find these files and copy them to my local directory of C:\Users\Documents\filetransfer.

So far i have
"C:\Program Files (x86)\WinSCP\WinSCP.com" /command ^
"option batch abort" ^
"option confirm off" ^
"open sftp://Username:Password@server.com/" ^
"cd "/app/manager/loading/"" ^
"get -filemask=*AAA C:\Users\Documents\filetransfer\"^
"exit"

Does anybody know what is wrong with this or how do you get certain files from a folder with a lot of sub folders? I have read all the links of documents but still cant seem to figure it out.

Thanks for your time