You have quotes wrong.
Correct syntax is either:
"put -latest ""x:\*""" ^
Or simply (as there are no spaces in the path):
"put -latest x:\*" ^
                
            
        
    
    
        
        
            
            
                Also when i look at the log, clearly i can see that correct file is selected, but why is it renamed?
File: 'X:\test.csv'
Copying 'X:\test.csv" to remote directory started.
...
STOR ^
150 Opening data channel for file upload to server of "/^"
226 Successfully transferred "/^"
Transfer done: 'X:\test.csv' => '/^' [5]
                
            
        
    
    
        
        
            
            
                WinSCP uploaded file gets renamed to ^.
If i upload the same file manually it works, same thing with command line.
When i create a batch script with WinSCP and i iuse it, then the file gets renamed, but why?
@echo off
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
  /log="C:\Temp\WinSCP log\WinSCP.log" /ini=nul ^
  /command ^
    "open ftpes://xxx/" ^
    "put -latest "x:\*" ^
    "exit"
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
  echo Success
) else (
  echo Error
)
exit /b %WINSCP_RESULT%