Código Delphi
[-]
procedure EjecutarPrograma(rutaPrograma,
parametros: string; esperar: boolean);
var
salida: DWord;
punteroInfo: PShellExecuteInfo;
infoEjecucion: TShellExecuteInfo;
begin
with infoEjecucion do
begin
cbSize := SizeOf(infoEjecucion);
fMask := SEE_MASK_NOCLOSEPROCESS;
wnd := GetActiveWindow;
lpVerb := nil;
lpFile := PChar(rutaPrograma);
lpParameters := Pchar(parametros + #0);
lpDirectory := nil;
nShow := SW_NORMAL;
hInstApp := 0;
end;
punteroInfo:= @infoEjecucion;
ShellExecuteEx(punteroInfo);
if esperar then
repeat
salida := WaitForSingleObject(infoEjecucion.hProcess, 500);
Application.ProcessMessages;
until (salida <> WAIT_TIMEOUT);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
EjecutarPrograma('osql','-b -U sa -P -i "'+ExtractFilePath(application.ExeName)+'EsthelDB.sql"',true);
end;
Donde se manda llamar EjecutarPrograma nada mas es k pongas el comando para ejecutar querys en MySQL, pero creo que esto te puede servir.
Si tienes alguna duda, pues lo comentas y veremos k se puede hacer