I am having a problem with terminating sandboxes in c++, when i launch Start.exe with /terminate_all i get an error saying "Usage: Start.exe <program name>"
now i dont know why it is doing this, it works fine with batch files
Code: Select all
void Shutdown()
{
//loop through all active sandboxes and terminate
// or just terminate all boxes.
//"C:\Program Files\Sandboxie\Start.exe" /terminate_all
PROCESS_INFORMATION processInformation;
STARTUPINFO startupInfo;
memset(&processInformation, 0, sizeof(processInformation));
memset(&startupInfo, 0, sizeof(startupInfo));
startupInfo.cb = sizeof(startupInfo);
char path[50];
// cfg.sbpath contains C:\Program Files\Sanboxie\Start.exe
strcpy(path,&cfg.sbpath[0]);
if(CreateProcess(path,"/terminate_all",0,0,0,0, 0, 0, &startupInfo, &processInformation) != ERROR_SUCCESS)
MessageBoxA(NULL,"Worked","Worked",MB_ICONEXCLAMATION);
else
MessageBoxA(NULL,"Failed","Failed",MB_ICONEXCLAMATION);
//
Sleep(1000);
}