Re: Prepend timestamp for wildcard upload deleting characters from filename
WinSCP operation masks do not support prepending (imo, it's actually how the masks work in general with all Windows/Linux command-line tools, so it should not be really surprising).
You would have to use more powerful scripting language. Like PowerShell with use of WinSCP .NET assembly.
https://winscp.net/eng/docs/library_powershell
Something like this (untested):
You would have to use more powerful scripting language. Like PowerShell with use of WinSCP .NET assembly.
https://winscp.net/eng/docs/library_powershell
Something like this (untested):
$remotePath = "/remote/path"
$timestamp = (Get-Date -Format "yyyyMMdd")
$dirInfo = $session.ListDirectory($remotePath)
foreach ($file in $dirInfo.Files)
{
$newName = $timestamp + "_" + $file.Name
$newPath = [WinSCP.RemotePath]::Combine($remotePath, $newName)
$session.MoveFile($file.FullName, $newName)
}