If I run the script manually from my normal user account, it works successfully. If I right click, run as another user, and chose run the script as the user account I'm logged in as, or run it as admin, or run it under Local System, I get the error below (System Error. Code: 3.)
Thoughts on how to get the script to work to run from Veeam following the backup job and/or be able to run the script successfully from other accounts?
@echo off Set DateTime=%date:~10%-%date:~4,2%-%date:~7,2%_%time:~0,2%.%time:~3,2%.%time:~6,2% REM echo %DateTime% Set SourcePath=V:\Critical-Offsite Set DestinationPath=/Veeam/Critical-Offsite "C:\Program Files (x86)\WinSCP\WinSCP.com" ^ /log="C:\SFTP\logs\Veeam.Critical.Offsite.SFTP_%DateTime%.log" /ini=nul ^ /command ^ "open ftps://user:firstname.lastname@example.org/ -certificate=""xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx""" ^ "synchronize remote -delete %SourcePath% %DestinationPath%" ^ "exit" set WINSCP_RESULT=%ERRORLEVEL% if %WINSCP_RESULT% equ 0 ( echo Success ) else ( echo Error ) exit /b %WINSCP_RESULT%