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

Viewed 3662

On my Windows machine I have a tiny script (.bat) to start a number of programs I use for my ordinary work such as Word, Outlook, a certain Excel file, etc.

An unsolved problem is that I cannot specify a certain Excel file that is stored in a local folder because the folder has a special character (German u-umlaut, i.e. ü) in its name. Something like:

C:\Büroeinrichtung\MyExcelFile.xlsx

In my script I try to call this via

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

but on running the script I get an alert indicating that the ü is not accepted (where the ü is replaced by some even more fancy signs on screen).

I can change the folder name by replacing ü by ue or whatever to circumvent the problem, but I would rather like a solution that allows leaving my existing folder names unchanged.

Didn't find the problem addressed in other questions here.

Is there a solution?

PS: I use Notepad++.

Later addition: There is a follow-up problem that still haunts me (although the initial problem is solved). It is regarding the approach to change the codepage programmatically with the chcp command from inside the script. See the question here

2 Answers

The previously suggestion solution was not working my case (i.e. using Hungarian special charachters), but it gave me in idea:

I used the dir /x to write into file:

dir <path> /x >>dir.txt

Using that I found the short folder name.

Related