title: Passing command line argument in AutoIt to PuTTY
body: <p>I am trying to implement launching PuTTY with AutoIt.</p>
  
  <p>I have a PuTTY configuration session, I named it <strong>'testcom11'</strong>. It saves a PuTTY session with settings for <strong>com11</strong>, <strong>baudrate</strong> and so on.</p>
  
  <p>I implemented in AutoIt a line as following:</p>
  
  <pre><code>Run ("putty -load testcom11")
  </code></pre>
  
  <p>It works fine. I was able to launch PuTTY with my session and PuTTY windows pops up and I was able to type an 'AT' command to the PuTTY window.</p>
  
  <p>Now I want, instead of hard coding one session name, to pass a session name from the command line like this:</p>
  
  <pre><code>myAutoItprogram.exe testcom11
  </code></pre>
  
  <p>I put this line in AutoIt:</p>
  
  <pre><code>$cmp = $CmdLine[1]
  </code></pre>
  
  <p>I can see it passed correctly when I print (display it with, let's say, MsgBox) <code>$cmp</code>, it shows <code>testcom11</code>.</p>
  
  <p>In the next line I have:</p>
  
  <pre><code>Run ("putty -load $cmp")
  </code></pre>
  
  <p>However, AutoIt launches PuTTY only with the window asking me to load a session. So clearly it didn't read the <code>-load $cmp</code> option.</p>
  
  <p>As you can see I am novice to AutoIt, so maybe you can see if it is something with how it handles <code>$cmp</code> in Run Window or something else.</p>