The CreateProcess function creates a new process and its primary thread. The new process executes the specified executable file.
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
);
runstr:='isql -S ' + sname + ' -i ' + pUnit.getPath + '\database\createdb.sql -U ' + uname + ' -P ' + upwd;
AssignFile(F1,getPath + '\database\setup.cmd');
rewrite(f1);
write(f1,runstr);
closeFile(f1);
If MessageBox(0,'Are you ready to create database?' + #13+#13 + 'Remember:'+#13+' If you had already created,redo this will destroy all your data.','Message',MB_YESNO)=IDYES then
begin
Messagebox(0,' Please wait a several seconds... ','Message',MB_OK);
ShellExecute(0,'',PChar(pUnit.getPath + '\database\setup.cmd'),nil,nil,SW_NORMAL);
end;