Thanks, that helped some. Connection is now working, but it complains about unknown command and path. I am not sure why. Here is the output:
C:\Program Files (x86)\WinSCP>winscp.com /command "open sftp://root@removed/ -hostkey="removed=" -privatekey="D:\Cryp\server\Private Keys\server.ppk"" ^
Searching for host...
Connecting to host...
Authenticating...
Using username "root".
Authenticating with public key "server" from agent.
Authenticated.
Starting the session...
Session started.
Active session: [1] root@removed
Unknown command '256'.
C:\Program Files (x86)\WinSCP>"synchronize local D:\server backups /root/winscp_sync"
The filename, directory name, or volume label syntax is incorrect.
The directories are correct, triple checked. Not sure if related to the
"Unknown command '256'."
New .bat contents:
cd C:\Program Files (x86)\WinSCP
winscp.com /command ^
"open sftp://root@removed/ -hostkey="removed=" -privatekey="D:\Cryp\server\Private Keys\server.ppk"" ^
"synchronize local D:\server backups /root/winscp_sync"
Do you see why it is failing?