Topic "Trouble putting a file with spaces in the name"

Author Message
DWVZ2000
[View user's profile]

Joined: 2015-07-27
Posts: 8
Location: USA
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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26331
Location: Prague, Czechia
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 %.
Guest




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
Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License