- 论坛徽章:
- 0
|
程序在WaitForSingleObject时候挂住了,cmd的命令已经执行完了,cmd中就执行了远端shell脚本的chmod命令,应该很快就返回值了,可是等了几个小时WaitForSingleObject也没有等待消息,远端的进程已经没有了。
SHELLEXECUTEINFO ShExecInfo = {0};
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = "cmd.exe ";
ShExecInfo.lpParameters = " ";
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_SHOW;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
WaitForSingleObject(ShExecInfo.hProcess,INFINITE); |
|