[英]How do I copy a file Or folder in the Program Files folder
How do I copy a file Or folder in the Program Files folder. 如何复制“程序文件”文件夹中的文件或文件夹。
Experimented with: 实验过:
system("xcopy pro_s\\pro C:\\Program Files /e /i /h");
But I did not succeed. 但是我没有成功。
Try 尝试
system("xcopy \"C:\\Program Files\\foldertocopy\" \"C:\\destination\" /e /i /h"); // Copy from
system("xcopy \"C:\\source\" \"C:\\Program Files\\foldertocopyinto\" /e /i /h"); // Copy to
The latter will need admin rights. 后者将需要管理员权限。
There is a space in "Program Files" which can cause issues. “程序文件”中有一个空格,可能会引起问题。 Try surrounding it with double quotes
\\"C:\\\\Program Files\\"
or try with "C:\\\\Progra~1"
尝试用双引号
\\"C:\\\\Program Files\\"
包围,或尝试使用"C:\\\\Progra~1"
If you are on C++, you can use mighty boost as well: See https://stackoverflow.com/a/2536438 or https://stackoverflow.com/a/8594696 or on windows see SHFileOperation API 如果您使用的是C ++,则还可以使用强大的Boost:请参阅https://stackoverflow.com/a/2536438或https://stackoverflow.com/a/8594696,或者在Windows上请参阅SHFileOperation API
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.