int nb_system(const char *cmd)
{
STARTUPINFOA si;
ZeroMemory(&si, sizeof(si));
si.cb = sizeof STARTUPINFO;
PROCESS_INFORMATION pi={0};
if(CreateProcessA(NULL,(LPSTR)cmd,NULL,NULL,TRUE,NORMAL_PRIORITY_CLASS | CREATE_NO_WINDOW,NULL,NULL,&si,&pi))
{
WaitForSingleObject(pi.hProcess ,INFINITE);
CloseHandle(pi.hProcess );
CloseHandle(pi.hThread );
}
else
{
return -1;
}
return 0;
}