有个bat文件xcopy /y %~dp0x64\43430r0nvram.txt %WINDIR%\System32\Drivers\
通过程序去调用bat文件,提示复制成功但是C盘下并没有文件。如果直接管理员运行bat文件就能复制成功C盘有文件,请问怎么回事?
1.UAC Executioin Level已经设置为 RequireAdministrator
2.直接在程序里CopyFile(_T("x64\43430r0nvram.txt"), _T("C:\Windows\System32\drivers\43430r0nvram.txt"), FALSE);也是不成功
3.C盘根目录可以,C:\windows\system32\drivers就不成功
C++复制文件到C:\windows\system32\drivers
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
6条回答
Greless 2017-03-22 07:38关注if (Wow64EnableWow64FsRedirection(FALSE))
{
// Any function calls in this block of code should be as concise
// and as simple as possible to avoid unintended results.ShellExecute(NULL, L"open", _T("CherryTrail\\AP6212\\Install_64_Auto.cmd"), NULL, NULL, SW_SHOWNORMAL); // Immediately re-enable redirection. Note that any resources // associated with OldValue are cleaned up by this call. if(FALSE== Wow64EnableWow64FsRedirection(TRUE)) { // Failure to re-enable redirection should be considered // a criticial failure and execution aborted. return; } } https://msdn.microsoft.com/en-us/library/aa365744.aspx本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报