Problems with scandinavian characters "File or Folder 'Operat÷r' does not exist" in WinSCP script

Advertisement

JPIT
Joined:
Posts:
4
Location:
Norway

Problems with scandinavian characters "File or Folder 'Operat÷r' does not exist" in WinSCP script

Hello,

I have recently taken over a WinSCP script at work that transfers files over from an old Windows Server 2012 R2 (Version 6.3 Build 9600) to another server using FTP protocol.

The script is a .bat (encoded with UTF-8 without BOM) that runs a /script for a .txt (also in UTF-8 no BOM) file that opens the FTP session.

The filepath from the server includes a Swedish letter ö. As in c:\operatör\files
I have an existing script that includes a filepath with no scandinavian letters and it works fine. But the second script comes with error:
File or Folder 'Operat÷r' does not exist
System error. Code:2
The system cannot find the file specified
I tried various methods that I found online and on these forums to no luck. When I try a similar setup on my own PC it works just fine, but not on the 2012 server. However if I run .bat files that simply move files from the same folder they work if I include chcp 1252 in the script. But it does not work if I try that in the WinSCP .bat script. Nor other chcp like 65001 or 1252.

WinSCP version is 6.1 (Build 13674)

Is there a way to fix this or a workaround I can use?
I am also quite new to this role, so apologies if I misunderstand some technical details.

Thanks!

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,040
Location:
Prague, Czechia

Re: Problems with scandinavian characters "File or Folder 'Operat÷r' does not exist" in WinSCP script

If you are using separate WinSCP script file, the chcp command have no effect on WinSCP (nor anything else in the batch file or its encoding).

Does the script file explicitly refer to the filename? Can you transfer that file in WinSCP GUI?

Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, use /log=C:\path\to\winscp.log command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

JPIT
Joined:
Posts:
4
Location:
Norway

Re: Problems with scandinavian characters "File or Folder 'Operat÷r' does not exist" in WinSCP script

The script name is rapport2.bat which contains the following:
"c:\program files (x86)\winscp\winscp" /script="c:\program files (x86)\winscp\rapporter2.txt" /log="c:\program files (x86)\winscp\rapporter2.log
pause
exit
The pause is temporary to see the error. The .bat script is in the same folder as winscp.exe.
Rapporter2.txt file contains the following:
open rapporter2
put -delete C:\VA-Operatör\removed\OUTPUT\Esave\Dygnsrapporter\*.* /rapporter2/Esave/Dygnsrapporter/
exit
The "removed" section also contains a letter ø in it, it is removed for privacy. The rapporter2 WinSCP session is a FTP with port 21. The same script works if I change the folders to something without scandinavian letters. I have attached the log file for rapporter2 with some information removed.

Thank you so much for taking your time to look into this.
  • rapporter2.log.txt (8.24 KB, Private file)
Description: This is a copy of the log exported to a new .txt file

Reply with quote

JPIT
Joined:
Posts:
4
Location:
Norway

To answer these questions more concretely:
Does the script file explicitly refer to the filename? Can you transfer that file in WinSCP GUI?
The filename of the file I want to transfer is simply Esave-Date" but it exists in the VA-Operatör folder. I transferring them via *.* inside the folder they exist. I can transfer the files just fine from the same path in the GUI.

Reply with quote

JPIT
Joined:
Posts:
4
Location:
Norway

Re: Problems with scandinavian characters "File or Folder 'Operat÷r' does not exist" in WinSCP script

I must apologize, it seems the problem was not the ö after all. I copied my script from an existing script that gets some files from a folder with no Scandinavian letters and it works fine. So I thought to simply copy it and import my own filepath there. It seems the error actually occurs because there is a space in-between the VA-Operatör and projects, not the ö despite it not showing up properly in the cmd window. The script requires double quotes "". I previously tested with single quote ''. And I got a syntax error, I assumed then that you cannot have quotes in the filepath inside the script. Today I tested with double quotes "" and it worked just fine.

Thank you for taking time to look into this.

Reply with quote

Advertisement

You can post new topics in this forum