I found an example of how to do it with SDK programming. It's shown below. This example runs the process, waits for it to finish, then checks the exit code. It assumes an exit code of 0 is success.
static int RunBatchFile (char *path)
{
PROCESS_INFORMATION pInfo;
STARTUPINFO sInfo;
int success = FALSE, exitCode, cursor;
cursor = GetWaitCursorState();
SetWaitCursor (1);
memset (&sInfo, 0, sizeof (sInfo));
sInfo.wShowWindow = LE_SHOWNORMAL;
sInfo.dwFlags = STARTF_USESHOWWINDOW;
sInfo.cb = sizeof (sInfo);
if (CreateProcess (NULL, path, NULL, NULL, FALSE, 0, NULL, NULL, &sInfo, &pInfo) == 0)
goto Error;
if (WaitForSingleObject (pInfo.hProcess, 6 * 60 * 60 * 1000) != WAIT_OBJECT_0) // 6 hour timeout
goto Error;
GetExitCodeProcess (pInfo.hProcess, &exitCode);
if (exitCode != 0) // assumes that these batch files return 0 on success
goto Error;
success = TRUE;
Error:
SetWaitCursor (cursor);
if (pInfo.hProcess)
CloseHandle (pInfo.hProcess);
return success;
}