.Bat xcopy – special characters

batch fileencoding

this is the code of my .bat file:

@echo off
xcopy "C:\Users\Administrator\věc" "C:\věc"  /e /i /h
echo Done
pause

However it says:File not found - výc. See ě char changed into ý

Why is it so? Thanks

Edit: I'm trying to copy directory, not a file

Best Answer

One option is to use a wildcard character for your locations:

xcopy "C:\Users\Administrator\v*c" "C:\v*c"  /e /i /h

It may not be ideal, but it'll work under a few conditioms.

  1. No other folders could match the expression 'v (any characters) c' (such as vehdgthc), that is true in the src and dest.

  2. The dir on c already exists for the dest.

Related Question