c++ 执行bat脚本(bat里面调用系统命令pnputil.exe)失败

我用 ShellExecute(NULL, L"open", _T("install.bat"), NULL, dirStr, SW_SHOWNORMAL);
install.bat里面 pnputil.exe找不到路径,如果直接执行install.bat的话pnputil.exe就能执行成功

1.build成64bit exe调用
2.用重定向,将文件系统关闭重定向,32bit程序调用64bit下文件。
http://blog.csdn.net/xiliang_pan/article/details/8031408

install.bat中用绝对路径调用pnputil.exe试试

尝试其他方法
1.install.bat里面我用xcopy C:\Windows\System32\pnputil.exe %~dp0 /Y /H也不能把他复制出来。直接执行就能
2.代码里用CopyFile也不能,但是复制notepad.exe就能成功,为什么pnputil.exe这个工具哪儿限制了呢
LPCWSTR source= _T("C://Windows//System32//pnputil.exe");//源文件
LPCWSTR destination = _T(".//pnputil.exe");//目标文件
CopyFile(source, destination, FALSE);//false代表覆盖,true不覆盖

我发现pnputil.exe受C++编译的exe文件有关系,如果系统是64bit,那么32bit exe程序就无法执行pnputil