title: Delphi 7: how to execute shell command and check the result?
body: <p>I'm using Delphi 7 and can't predict the target version of Windows.</p>
  
  <p>I need to create a database (probably MySql, but might be something else) and define some table structures. I do not need to populate any data. Unfortunately, all of the ADO components seem to expect that a database already exists and they will then allow you to manipulate it.</p>
  
  <p>So, since it's only a few simple commands, I thought that I might as well use ShellExectute().</p>
  
  <p>Agree? Disagree?</p>
  
  <p>Can anyone give me a sample code which will attempt to run "MySql --version" and let me check the result? After that I should be able to figure it out for myself. Thanks.</p>
  
  <hr>
  
  <p>[edit]</p>
  
  <p>No offence intended, but I do know how to google. It's just that I don't find useful results. It's my own fault for not being explicit in this question, so please accept my apology - what I need is a code example, not just the name of a component.</p>
  
  <p>Sorry (and thanks for the replies so far (all of which are +1))</p>
  
  <hr>
  
  <p>[edit]</p>
  
  <p>The links which Robert gives do the job (procedure RunDosInMemo() does the trick) ... <strong>B U T</strong>  you Must remember to include an .exe extension (so, 'notepad.exe', not just 'notepad', and to ge a full path if your command is not on the path.</p>