Command to Specify a Space in Remote Directory Path in a .cmd file

Advertisement

jodikohn
Joined:
Posts:
2
Location:
United States

Command to Specify a Space in Remote Directory Path in a .cmd file

Remote directory to drop file(s) has a space in its name. What's the correct syntax for this statement? I can drop the files into the New Directory using the UI just fine.

Here's an example: "put \\servername\sharename\*.txt /New Directory"

Generate session URS/code shows to reference it after the port as /New%20directory/ That doesn't work. The log shows it is trying to drop it in /New0directory

Excerpt from log: Copying 1 files/directories to remote directory "/New0directory"

Thanks,
Jodi

Reply with quote

Advertisement

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

Re: Command to Specify a Space in Remote Directory Path in a .cmd file

jodikohn wrote:

Generate session URS/code shows to reference it after the port as /New%20directory/ That doesn't work. The log shows it is trying to drop it in /New0directory
That's for URL. But you want "script", right? So switch to "Script" tab, it will show you this syntax:
"put \\servername\sharename\*.txt ""/New Directory/"""

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

Reply with quote

jodikohn
Joined:
Posts:
2
Location:
United States

Re: Command to Specify a Space in Remote Directory Path in a .cmd file

@Martin - Thanks for your response and the link to the command line syntax. I remember trying that too without success.

Long story short... I reached out to the receiving party and asked if they would remove the space between the two words in the directory name. They did, and everything is working now.

We can put this one to bed.

Reply with quote

Advertisement

You can post new topics in this forum