I'm trying to use xcopy command to copy a file with utf-8 file name from windows server(2008 R2 Standard) machine to another remote server(Windows 10), and I use MapNetworkDrive command to map the network drive.
try{
$WshNetwork = new COM("WScript.Network");
$WshNetwork->MapNetworkDrive("k:", SERVER_FOLDER, FALSE, SERVER_USER, SERVER_PASSWORD);
}catch(Exception $ex){}
echo f | xcopy "myFolder\тест.fbx" "k:\myFolder\тест.fbx" (1)
As an output I get out=0 File(s) copied ret=4.
There are 3 important things I want to mention
When I use the above command with a file named with latin letters it works. For example
echo f | xcopy "myFolder\test.fbx" "k:\myFolder\test.fbx"works fine.When I try to use
(1)command to copy the file(with non-latin letters) to another folder located on the same machine, everything successes. For exampleecho f | xcopy "C:\\myFolder\тест.fbx" "C:\\myFolder\subFolder\тест.fbx"this command also works fine.When I try to copy via
(1)the file from my local machine(windows 10) to the remote server(windows 10), it also works fine.
Why (1) command doesn't do the copy operation?