Search

robocopy.exe fails when using chcp 65001 by Ajoschi Roth

Active

2
0
Sign in
to vote
Type: Bug
ID: 770314
Opened: 11/7/2012 12:45:45 AM
Access Restriction: Public
0
Workaround(s)
1
User(s) can reproduce this bug
I use "C:\Windows\system32\robocopy.exe" in a batch file to copy a file including Unicode characters in the file name.
Before calling robocopy.exe I set the code page to UTF8 (chcp 65001). -> The call of the robocopy.exe will not do the expected operation

Note: When I copy the robocopy.exe from its original destination ("C:\Windows\system32") to e.g. "C:\Temp" and use the copied robocopy.exe in my batch file all works fine!


Operating system is Windows 7 Ultimate 64bit (German)
Version of Robocopy.exe is 5.1.10.1027
Details (expand)
How often does this happen?
Always Happens

Have you seen this problem before in this product?

I don't know if this issue existed previously
Reproduction Steps
1. Paste the following code to a text editor (e.g. notepad++) and save it as "test.bat" using encoding "UTF8 without BOM":
@echo off
chcp 65001
"C:\Windows\System32\ROBOCOPY.exe" "C:\Test1" "C:\Test2" "中文.txt"
pause
2. Create a file with full path "C:\Test1\中文.txt".
3. Create a new empty directory "C:\Test2".
2. Run the file "test.bat"

Result: No file is copied, but robocopy.exe returns "The operation completed successfully."
Expected Results
File "中文.txt" should be copied from directory "C:\Test1" to "C:\Test2".
File Attachments
0 attachments
Sign in to post a comment.
Posted by Ajoschi Roth on 11/15/2012 at 5:30 AM
I wonder if there is any news on this issue?
Sign in to post a workaround.