Hi!
I'm trying to script a simple synchronize, but getting an
"invalid access to memory" error:
My version: 6.3 Build 14793
My script:
$LocalPath = "D:\BACKUPS"
$RemotePath = "/backup_folder"
$TaskStartTime = (Get-Date).ToString('yyyy-MM-dd__hh_mm_ss')
# Needed for PowerShell 7.3 and newer
$PSNativeCommandArgumentPassing = "Legacy"
& "C:\Program Files (x86)\WinSCP\WinSCP.com" `
/log="D:\ProgramData\WinSCP\logs\task_sync_FTP_$TaskStartTime.log" /ini=nul `
/command `
"open ftpes://user:passhere@serveraddress:21/ -rawsettings ProxyPort=0" `
"synchronize remote $LocalPath $RemotePath -criteria=checksum -preservetime -resumesupport=on -preview" `
"exit"
$winscpResult = $LastExitCode
if ($winscpResult -eq 0)
{
Write-Host "Success"
}
else
{
Write-Host "Error"
}
exit $winscpResult
The output:
Connecting to server:21 ...
TLS connection established. Waiting for welcome message...
Connected
Starting the session...
Session started.
Active session: [1] user@server
Comparing...
Local 'D:\BACKUPS\folder1' => Remote '/backup_folder/folder1'
Invalid access to memory.
Please help us improving WinSCP by reporting the error on WinSCP support forum.
Error
I'd be happy for your help! :)