Encoding problem when executing a WinSCP script generated using MS SQL Server

Advertisement

konraddo
Joined:
Posts:
2
Location:
Poland

Encoding problem when executing a WinSCP script generated using MS SQL Server

Hello, i have a problem:
I'm using WinSCP to upload files to a server using script, since I store files list in MS SQL database, I tried to create a script for WinSCP from SQL Stored procedure by concatenating strings and saving results to file using SQL CLR assembly, but it seems there's a problem with newline characters - in SQL i use CHAR(13) + CHAR(10) and when i'm trying to connect to server using WinSCP i've got error:
"Ambiguous command 'o'. Possible matches are: open, option".
But when I edit this script manually in notepad.exe, even if i don't edit a single character and save it, it works. How should i properly handle newline characters for WinSCP?
Or is there a way to change accepted encoding of scripts in WinSCP? I googled about encoding settings in WinSCP but if i understand correctly, you can change encoding of files transferred using WinSCP, not encoding of the WinSCP script.

Reply with quote

Advertisement

konraddo
Joined:
Posts:
2
Location:
Poland

Okay, so i post attachment with script that i'm executing (i'm not pasting it on pastebin.com or somewhere else because it could possibly affect encoding?).

This is how i execute this script:

winscp.com /script=G:\Synchronize_photos\20170601_121717.txt
this gives me this error:
Ambiguous command 'o'. Possible matches are: open, option.

When i try to execute another version of this script (edited and saved in Notepad without doing any modifications), WinSCP successfully executes this script:
winscp.com /script=G:\Synchronize_photos\20170601_121717_savedInNotepad.txt
Searching for host...
Network error: Connection to "examplewebsite.com" timed out.
which is of course fine because i changed actual URL with this fake example.

Reply with quote

Advertisement

You can post new topics in this forum