man kunne kalde funktionen CreateProcess der er defineret således
BOOL CreateProcess(
LPCTSTR lpApplicationName, // pointer to name of executable module LPTSTR lpCommandLine, // pointer to command line string LPSECURITY_ATTRIBUTES lpProcessAttributes, // pointer to process security attributes LPSECURITY_ATTRIBUTES lpThreadAttributes, // pointer to thread security attributes BOOL bInheritHandles, // handle inheritance flag DWORD dwCreationFlags, // creation flags LPVOID lpEnvironment, // pointer to new environment block LPCTSTR lpCurrentDirectory, // pointer to current directory name LPSTARTUPINFO lpStartupInfo, // pointer to STARTUPINFO LPPROCESS_INFORMATION lpProcessInformation // pointer to PROCESS_INFORMATION );
Result = CreateProcess ( "C:\\cert\\start.bat", // pointer to name of executable module NULL, // pointer to command line string NULL, // pointer to process security attributes NULL, // pointer to thread security attributes false, // handle inheritance flag 0, // creation flags NULL, // pointer to new environment block "C:\\cert\\", // pointer to current directory name &StartupInfo, // pointer to STARTUPINFO &ProcessInformation // pointer to PROCESS_INFORMATION );
if (!Result) { Memo1->Lines->Add("Create Process failed. Errorcode: "+IntToStr(GetLastError())); }else { Memo1->Lines->Add("Create Process OK"); } }
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.