Make transfer with script
Hello,
I hope someone can help me with my issue, I have always loved WinSCP and used it, thanks so much for a great program. I've just started to make some scripts and I stumble across a issue now.
I need a script that moves from a FTP to a SMB share. The file that comes to FTP changes name everyday since it takes actual day in the ending of the file.
I managed to get a script function well but that was when file was same name all the time. How do I create a script that takes this file and moves it to a SMB then renames it.
The rename is always the same that should land on SMB share.
The file I transfer from FTP is always the same name in the beginning 6 digits.
This is "my" generated script without the rename and when the file was same name all the time:
I hope someone can help me with my issue, I have always loved WinSCP and used it, thanks so much for a great program. I've just started to make some scripts and I stumble across a issue now.
I need a script that moves from a FTP to a SMB share. The file that comes to FTP changes name everyday since it takes actual day in the ending of the file.
I managed to get a script function well but that was when file was same name all the time. How do I create a script that takes this file and moves it to a SMB then renames it.
The rename is always the same that should land on SMB share.
The file I transfer from FTP is always the same name in the beginning 6 digits.
This is "my" generated script without the rename and when the file was same name all the time:
$PSNativeCommandArgumentPassing = "Legacy" & "C:\Program Files (x86)\WinSCP\WinSCP.com" ` /log="C:\Program Files (x86)\WinSCP\script\Log\WinSCP.log" /ini=nul ` /command ` "open sftp://XXXXXXXXXXXX" ` "cd /Folder/foldername" ` "lcd \\SMB-share" ` "get 12345678" ` "exit" $winscpResult = $LastExitCode if ($winscpResult -eq 0) { Write-Host "Success" } else { Write-Host "Error" } exit $winscpResult