title: Shellexec vs Exec vs Shellexec my batch file
body: <p>I don't find in the help an exhaustive explanation of the difference between Shellexec and Exec. Is the</p>
  
  <pre><code>Shellexec('','program.exe',params,'',SW_HIDE,ewWaitUntilTerminated,ResultCode) 
  </code></pre>
  
  <p>equivalent to </p>
  
  <pre><code>Exec('program.exe',params,'',SW_HIDE,ewWaitUntilTerminated,ResultCode) 
  </code></pre>
  
  <p>when working with exe files? Of course, when I want execute a file different from exe or batch, use Shellexec.</p>
  
  <p>Sometimes, however, I can't get my istruction to work correctly neither by Shellexec nor Exec. The only solution that always work is to write a batch file and run it via shellexec. Personally I don't like this solution because I have to deal with a temporary file and I don't trust the resultcode obtained.
  Now I'll have to get back to the batch file solution, because I don't know how to get this instruction work: (the error is that it raises the instruction fails if the destination file is not already present, while in command prompt the instruction works even the destination file does not exist).</p>
  
  <pre><code>mysqldump := 'C:\Program Files (x86)\MySQL\MySQL Server 5.0\bin\mysqldump.exe';
  params := '-uroot -ppassword myschema&gt;C:\myappdir\backup\newbackup.sql'; 
  //the destination folder exists, the file newbackup.sql does not exist      
  Shellexec('',mysqldump,params,'',SW_HIDE,ewWaitUntilTerminated,ResultCode);
  </code></pre>
  
  <p>I am working on Windows 7 64 bit, the program (an Inno Setup installer) is run with administrative rights</p>