C++ Terminating Sandboxes

If it doesn't fit elsewhere, it goes here
Post Reply
fusion
Posts: 2
Joined: Sat Mar 16, 2013 10:20 am

C++ Terminating Sandboxes

Post by fusion » Sat Mar 16, 2013 10:28 am

Hi,

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);
}
any help is appreciated

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest