Trouble putting a file with spaces in the name

Advertisement

DWVZ2000
Joined:
Posts:
10
Location:
USA

Trouble putting a file with spaces in the name

I am having a problem sending a file to an FTP site that has spaces in the file name. I have tried single quotes, double quotes, double double quotes, etc. and nothing seems to work. It keep saying ".....system file not found....".

I am using Winscp Version 5.7.7 Build 6257.

Below is the script I am using. It keep showing that the file name is "Server1\MyFiles\Daily ".


="C:\Program Files\WinSCP\WinSCP.exe /console /command ""option confirm off"" ""option batch off"" ""open FileList"" ""put \\Server1\MyFiles\\" & ""Daily Inpatient File"" & "*%TimeStamp#yyyy-mm-dd%" & ".csv"" ""exit"" "

Thank you very much for your assistance.

David

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,811
Location:
Prague, Czechia

Re: Trouble putting a file with spaces in the name

Well, we need to know, what language is that.

If it is VB, it should be like:

="""C:\Program Files\WinSCP\WinSCP.exe"" /console /command ""option confirm off"" ""option batch off"" ""open FileList"" ""put """"\\Server1\MyFiles\Daily Inpatient File*%TimeStamp#yyyy-mm-dd%.csv"""""" ""exit"" "

See also https://winscp.net/eng/docs/commandline#syntax

Depending on a way you execute the command, you may also need to double the %.

Reply with quote

Guest

Re: Trouble putting a file with spaces in the name

martin wrote:

Well, we need to know, what language is that.

If it is VB, it should be like:

="""C:\Program Files\WinSCP\WinSCP.exe"" /console /command ""option confirm off"" ""option batch off"" ""open FileList"" ""put """"\\Server1\MyFiles\Daily Inpatient File*%TimeStamp#yyyy-mm-dd%.csv"""""" ""exit"" "

See also https://winscp.net/eng/docs/commandline#syntax

Depending on a way you execute the command, you may also need to double the %.



Martin,

Yes it was VB, and your code worked.
Thank you very much for your help.

David
:D :D :D :D :D :D

Reply with quote

Advertisement

You can post new topics in this forum