startup.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
}
- cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c ")+2);
- sprintf(cmd, "%s /c \"%s\"", TWG(comspec), command);
+ cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c "));
+ sprintf(cmd, "%s /c %s", TWG(comspec), command);
if (!CreateProcess(NULL, cmd, &security, &security, security.bInheritHandle, NORMAL_PRIORITY_CLASS|CREATE_NO_WINDOW, env, cwd, &startup, &process)) {
return NULL;
}