WinExec(“cmd.exe netstat -an”,SW_SHOW); //不执行;
WinExec(“cmd.exe /c netstat -an”,SW_SHOW); //执行,但一闪而过;
WinExec(“cmd.exe /k netstat -an”,SW_SHOW); //成功;
使用例子:
WinExec(“cmd.exe /k xxx.bat”, SW_SHOWNORMAL);
WinExec(“cmd.exe netstat -an”,SW_SHOW); //不执行;
WinExec(“cmd.exe /c netstat -an”,SW_SHOW); //执行,但一闪而过;
WinExec(“cmd.exe /k netstat -an”,SW_SHOW); //成功;
使用例子:
WinExec(“cmd.exe /k xxx.bat”, SW_SHOWNORMAL);