Дуже раджу читати документацію:
https://doc.qt.io/qt-5/qprocess.html#startDetached
bool QProcess::startDetached(qint64 *pid = nullptr)
...
If the function is successful then *pid is set to the process identifier of the started process.
https://docs.microsoft.com/uk-ua/window … se-winexec
Note This function is provided only for compatibility with 16-bit Windows. Applications should use the CreateProcess function.
Тобто або (Qt)
QProcess *vec = new QProcess(this);
vec->setProgram("%WinDir%\\System32\\сscript.exe");
vec->setArguments("F:\\anki\\ManyErr.vbs");
int pid;
bool started = vec->startDetached(&pid);
або (WinAPI)
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
BOOL started = CreateProcess(NULL, "F:\\anki\\ManyErr.vbs", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
або навіть (C++ standard)
std::system("start F:\\anki\\ManyErr.vbs");