Topic "WinSCP.com and whitespaces"

Author Message
nerys64
[View user's profile]

Joined: 2013-06-25
Posts: 1
if there is a whitespace in the file name, winscp.com stops reading after the white space. Using double and single quotes does not fix this behavior. Using full path instead of relative path does not fix this behavior.



Code:

C:\Users\shrimants\TEST>dir /s /b
C:\Users\shrimants\TEST\batch.bat
C:\Users\shrimants\TEST\filelist.tmp
C:\Users\shrimants\TEST\testscript (1).txt
C:\Users\shrimants\TEST\testscript (2).txt
C:\Users\shrimants\TEST\testscript (3).txt
C:\Users\shrimants\TEST\testscript (4).txt
C:\Users\shrimants\TEST\testscript (5).txt
C:\Users\shrimants\TEST\testscript (6).txt
C:\Users\shrimants\TEST\testscript.winscp

C:\Users\shrimants\TEST>"c:\Program Files (x86)\WinSCP\WinSCP.com" /script=tests
cript.winscp /parameter 'testscript (1).txt'
batch           abort
confirm         off
Searching for host...
Connecting to host...
Authenticating...
Using username "shrimant".
Authenticating with pre-entered password.
Authenticated.
Starting the session...
Reading remote directory...
Session started.
Active session: [1] shrimant@login.umd.umich.edu
C:\Users\shrimants\TEST
/home/user/s/h/shrimant/TEST
transfer        binary
File or folder ''testscript' does not exist.
System Error.  Code: 2.
The system cannot find the file specified
(A)bort, (R)etry, (S)kip, Ski(p) all: Abort

C:\Users\shrimants\TEST>"c:\Program Files (x86)\WinSCP\WinSCP.com" /script=tests
cript.winscp /parameter "testscript (1).txt"
batch           abort
confirm         off
Searching for host...
Connecting to host...
Authenticating...
Using username "shrimant".
Authenticating with pre-entered password.
Authenticated.
Starting the session...
Reading remote directory...
Session started.
Active session: [1] shrimant@login.umd.umich.edu
C:\Users\shrimants\TEST
/home/user/s/h/shrimant/TEST
transfer        binary
File or folder 'testscript' does not exist.
System Error.  Code: 2.
The system cannot find the file specified
(A)bort, (R)etry, (S)kip, Ski(p) all: Abort
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
1) Use double-quotes, not single-quotes.
2) Make sure you surround the %1% with double-quotes too. See:
http://winscp.net/eng/docs/scripting#syntax
_________________
Martin Prikryl
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