I want to do a very simple thing: Copy a file.
Copy is a simple (and fundamental) command. It should be easy, but it seems to be complicated when it comes to Unicode filenames (using
cmd.exe, and a
I have managed to create a .cmd file with the Unicode filenames, as follows
:: To create the final .cmd script :: set SRCE=D:\_cmd\cpp set DEST=H%SRCE:~1% cmd.exe /U /c DIR /A:-D /s /b "%SRCE%" >"SRCE.UTF16" cmd.exe /U /c DIR /A:-D /s /b "%DEST%" >"DEST.UTF16" ConvUTF.exe 1628 "DEST.UTF16" "DEST.UTF-8" ConvUTF.exe 1628 "SRCE.UTF16" "SRCE.UTF-8" :: Then, with `sed.exe`, `diff.exe`, and `ConvUTF.exe` again... :: the resulting UTF-8 (or UTF16) .cmd file looks like this... :: copy "D:\_cmd\cpp\ā.क.test" "H:\_cmd\cpp\"
copy command works fine when I run it directly at the
command prompt, but fails, when used in the
.cmd errors out with:
The system cannot find the file specified
.cmd doesn't get past the first NULL-byte (of the first character), and just exits.
Is there some way to do it from a
.cmd script? (I want to use the
Perhaps there is a utility program which can be called from my
All suggestions are welcome.
PS. To clarify the manin issue... I don't care about how Unicode filenames display in the console window (That just doesn't happen for most non-latin-based letters in the cmd.exe window)... I am only interesterd in being able to copy a file which has Unicode letters in its filename- via a batch .cmd "script".