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.