Copying directories with the special symbol ®

I am making a batch file to copy some directories and subdirectories to a safe location (backup tasks). But if the path contains special characters like ®, then the script does not work.

:: Call Of Duty® 2
xcopy "F:\Archivos de Programa\Call Of Duty® 2\main\players" "D:\BackUp\savegames\Call Of Duty® 2\main\players\" /E /F /Y

      

The console displays a "like" icon, so a "not found" exception appears.

I tried using UTF-8 and ANSI encoding, but neither worked.

+3


source to share


1 answer


I think it works if you also change the console codepage to 65001, which is a "sort of" UTF-8 codepage. To do this, you must add the command to your batch file:

:: Call Of Duty® 2
chcp 65001
xcopy "F:\Archivos de Programa\Call Of Duty® 2\main\players" ^
    "D:\BackUp\savegames\Call Of Duty® 2\main\players\" /E /F /Y

      



For more information on 65001 read: Is the code page 65001 and utf-8 the same? or google 65001+ "UTF-8"

+5


source







All Articles