white wrote: 2024-11-21, 00:05 UTCBut type converts to current codepage, does it not?
I can't remember the last time I had to process filenames with characters from other codepages in a batch script, or if I ever did that, so I honestly don't know.
[...] but I thought in general you need to use chcp 65001 (which is a pain).
True.
Here's the conclusion I draw from the discussion: If you don't need to worry about Unicode characters or from other codepages, the approach shown by
3axarko is likely sufficient and works out of the box since it makes use of the tools available in Windows (at least since Vista). However, external tools like
NTFS Links or
NTLinks Maker can properly handle Unicode and it's probably better to use them if one has to process such files on a regular basis. It's not that hard to include them even in a portable TC either.