6 个解决方案
#1
sleep(2000);
#2
if WinExec(PChar(filename),SW_SHOWNORMAL) > 31 then
begin
//--
end;
#4
谢谢楼上的大哥
结贴
结贴
#5
String strAttchPath ="";
if(strDestIPAddress != "")
{
PROCESS_INFORMATION pi;
STARTUPINFO si;
si.cb = sizeof(STARTUPINFO);
si.lpReserved = NULL;
si.lpDesktop = NULL;
si.lpTitle = NULL;
si.dwFlags = 0;
si.cbReserved2 = 0;
si.lpReserved2 = NULL;
String cmd = "";
if(nDestPort != -1)
{
cmd = "cmd.exe /c .\\test.bat" + strDestIPAddress+" "+AnsiString(nDestPort)
+" "+Filename;
}
else
{
cmd = "cmd.exe /c .\\test.bat " + strDestIPAddress+" 80 "+Filename;
}
BOOL bRet = CreateProcess(NULL,cmd.c_str(),NULL,NULL,false,
NORMAL_PRIORITY_CLASS,
NULL,NULL,&si,&pi);
if(bRet == false)
{
//Application->MessageBox("执行test.bat出错!","错误t",MB_OK);
}
else
{
CloseHandle(pi.hThread);
DWORD dwret=WaitForSingleObject(pi.hProcess, INFINITE); //INFINITE
CloseHandle(pi.hProcess);
strAttchPath = ExtractFilePath(Application->ExeName)+ Filename;
}
}
#6
dfdsfsdf
#1
sleep(2000);
#2
if WinExec(PChar(filename),SW_SHOWNORMAL) > 31 then
begin
//--
end;
#3
#4
谢谢楼上的大哥
结贴
结贴
#5
String strAttchPath ="";
if(strDestIPAddress != "")
{
PROCESS_INFORMATION pi;
STARTUPINFO si;
si.cb = sizeof(STARTUPINFO);
si.lpReserved = NULL;
si.lpDesktop = NULL;
si.lpTitle = NULL;
si.dwFlags = 0;
si.cbReserved2 = 0;
si.lpReserved2 = NULL;
String cmd = "";
if(nDestPort != -1)
{
cmd = "cmd.exe /c .\\test.bat" + strDestIPAddress+" "+AnsiString(nDestPort)
+" "+Filename;
}
else
{
cmd = "cmd.exe /c .\\test.bat " + strDestIPAddress+" 80 "+Filename;
}
BOOL bRet = CreateProcess(NULL,cmd.c_str(),NULL,NULL,false,
NORMAL_PRIORITY_CLASS,
NULL,NULL,&si,&pi);
if(bRet == false)
{
//Application->MessageBox("执行test.bat出错!","错误t",MB_OK);
}
else
{
CloseHandle(pi.hThread);
DWORD dwret=WaitForSingleObject(pi.hProcess, INFINITE); //INFINITE
CloseHandle(pi.hProcess);
strAttchPath = ExtractFilePath(Application->ExeName)+ Filename;
}
}
#6
dfdsfsdf