Windows batch: Unicode parameters for (robo) copy command

前端 未结 3 962
傲寒
傲寒 2021-01-17 18:57

I need to copy multiple files in a single batch file. The files have Unicode names that map to different codepages.

Example:

set Ara         


        
3条回答
  •  星月不相逢
    2021-01-17 19:21

    If

    • I add CHCP 65001 as the first line of your batch file,
    • save the file as UTF-8 without BOM, and
    • set my console font to something else than "Raster Fonts" (on my Win7 box I can choose Consolas or Lucida Console),

    it works. Simple, no? :-)

    (The font change is actually not necessary, provided you're not writing non-ASCII output to the console.)

提交回复
热议问题