title: Windows form application command line arguments
body: <p>I have searched through Google and here found many examples but I can't seem to get my Windows Form application to run and take arguments form the command line. I really want to have the option of scheduling the application without having a console version. But every time I setup the cmd line arguments it errors out with a  CLR20r3 error.</p>
  
  <pre><code>static void Main(string[] args)
  {
     if(args != null &amp;&amp; args.Length &gt; 0)
     {
        /*
        * arg[1] = Backup Location *require
        * arg[2] = Log File - Enable if present *optional
        * arg[3] = Debug Messages - Enabled if present *optional
        * arg[4] = Backup Type - Type to perform *required
        */
  
     }
     else
     {
       Application.EnableVisualStyles();
       Application.SetCompatibleTextRenderingDefault(false);
       Application.SetUnhandledExceptionMode(UnhandledExceptionMode.Automatic);
       Application.Run(new Form1());
     }
  }
  </code></pre>
  
  <p>Anytime I try to pass an arg it errors ex</p>
  
  <blockquote>
    <p>myapp.exe "C:\Backup\" => CLR20r3</p>
  </blockquote>