title: How Do I Compile a C Program to Run Without a Command Box?
body: <p>I need a very simple program to run on any version of Windows, let's say >= Win 98, without requiring any pre-installed framework like dotnet. I thought C would be a great idea to do this.</p>
  
  <p>The program should start a process from the parent directory by using a system command.</p>
  
  <blockquote>
    <p>Start C program (invisible) > program starts process > program exits</p>
  </blockquote>
  
  <p>This is how it looks:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main() {
      system("..\\someprogram.exe");
      return 0;
  }
  </code></pre>
  
  <p>I call this program from a Flash projector, which only allows to start programs in a specific subfolder "fscommand" – but I have to start a process located in the same directory as the projector.</p>
  
  <p>Anyway, it works fine! But the C program opens a command box, then starts the process and leaves the command box open as long as the process runs. So here is how it should work, in order how i would appreciate it:</p>
  
  <ol>
  <li>Do not open a command box at all (I'd like that, really ;)</li>
  <li>Both 3) and 4)</li>
  <li>Close the command box after starting the process (exit the C program)</li>
  <li>Open the command box minimized by default</li>
  </ol>
  
  <p>I can't change any Windows settings for the C executable or use a shortcut, as this will run directly from a CD later.</p>
  
  <p>I use Open Watcom to compile my program. Both image types (target options) that produce an executable (Character-mode Executable / Windowed Executable) have the same result.</p>