How to specify a local file with special characters in its name or path, for example, ä, ö, ü in a Windows batch file?

On my Windows machine, I have a small script (.bat) to run a number of programs that I use for my normal work, such as Word, Outlook, a specific Excel file, etc.

The unresolved problem is that I cannot specify any Excel file that is stored in the local folder, because the folder has its own character (German u-umlaut, i.e. ü). Sort of:

C:\Büroeinrichtung\MyExcelFile.xlsx

In my script, I am trying to call this via

Start "" "C:\Büroeinrichtung\MyExcelFile.xlsx"

but when I run the script, I get a warning that ü is not accepted (where ü is replaced by some even more bizarre characters on the screen).

I can change the name of the folder by replacing ü with ue or whatever it takes to get around the problem, but I would prefer the solution to leave my existing folder names unchanged.

No problem found raised in other issues here.

Is there a solution?

PS: I am using Notepad ++.

Later adding: . There is another problem that still haunts me (although the initial problem has been resolved). This concerns the approach to programmatically modifying a code page using the chcp command from a script. See the question here

+4
source share
1 answer

The problem is in different encodings: ANSI and ASCII. There are various solutions:

  • Use another editor with the ability to change the encoding.
  • Umlaut .
  • CMD, dir/x, Büroeinrichtung DOS Script.
+3

Source: https://habr.com/ru/post/1678240/


All Articles