dotws86260 2018-06-06 11:50
浏览 145
已采纳

xcopy通过映射的网络驱动器utf-8文件名。 RET = 4

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

  1. 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.

  2. 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 example echo f | xcopy "C:\\myFolder\тест.fbx" "C:\\myFolder\subFolder\тест.fbx" this command also works fine.

  3. 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?

  • 写回答

1条回答 默认 最新

  • duanliu6083 2018-07-04 15:56
    关注

    The problem in my case was php version, I was using php 7.0, which doesn't work with unicode charactes. I don't know are there any other solutions, for earlier versions, but I've upgraded my php to 7.2 and problem was solved. Also I've found in other questions, that the problem disappears with php 7.1 and upper versions.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 为什么apriori的运行时间会比fp growth的运行时间短呢
  • ¥15 帮我解决一下膳食平衡的线性规划模型的数据实例
  • ¥40 万年历缺少农历,需要和阳历同时显示
  • ¥250 雷电模拟器内存穿透、寻基址和特征码的教学
  • ¥200 比特币ord程序wallet_constructor.rs文件支持一次性铸造1000个代币,并将它们分配到40个UTXO上(每个UTXO上分配25个代币),并设置找零地址
  • ¥15 关于Java的学习问题
  • ¥15 如何使用chatgpt完成文本分类任务?
  • ¥15 已知速度v关于位置s的等式,怎么转化为已知位置求速度v的等式
  • ¥15 我有个餐饮系统,用wampserver把环境配置好了,但是后端的网页却进去,是为什么,能不能帮远程一下?
  • ¥15 R运行没有名称为"species"的插槽对于此对象类"SDMmodelCV"