Filemask errror

Advertisement

Help please
Guest

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

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
29,540
Location:
Prague, Czechia

Re: Filemask errror

start with AAA
That would be AAA*, not *AAA.

Reply with quote

Help please
Guest

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"

Reply with quote

help please
Guest

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

Reply with quote

Advertisement

Help please
Guest

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

Reply with quote

Advertisement

You can post new topics in this forum