Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

lbrewerton wrote:

This is using a stored connection so connection details should not be necessary?

But you still need the open command.
And using stored sites in the script is not recommended:
https://winscp.net/eng/docs/scripting#configuration

When I use winscp.com I get a "no mapping for the unicode character exists in the target multibyte code page" error

Make sure the script uses UTF-8 encoding.
lbrewerton

This is using a stored connection so connection details should not be necessary?

When I use winscp.com I get a "no mapping for the unicode character exists in the target multibyte code page" error
lbrewerton

/script not firing

I have a Windows CMD file -

@echo off

start "C:\Program Files (x86)\WinSCP\WinSCP.exe" /script=C:\HyveSync\Automation\KBStaffSync.txt /xmllog=C:\HyveSync\Automation\log.txt


The script file is this:-

# Automatically abort script on errors

option batch continue
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect using stored connection
sftp://KBStaff

# Force binary mode transfer
option transfer binary
 
synchronize remote C:\Tomcat\Websites\Shared\staffwiki /kbstaff
 
# Disconnect
close
exit


But when I fire the CMD file either by using the shortcut or from command line, nothing seems to happen and my log file is empty, but if I use the WinSCP console and copy/paste the commands from the script file into the WinSCP console then it works fine.