title: How to give commands in a CMD window using AutoIt (*.au3) scripts?
body: <p>What I have tried and didn't work:</p>
  
  <ol>
  <li>I opened <code>cmd.exe</code></li>
  <li>Typed "cd\"  >> without quotes</li>
  <li>Pressed <kbd>Enter</kbd></li>
  <li>Typed "cd C:\Program Files (x86)\Jenkins"</li>
  <li>Pressed <kbd>Enter</kbd></li>
  <li>Typed "jenkins.exe start"</li>
  <li>Pressed <kbd>Enter</kbd></li>
  </ol>
  
  <p>I have also used the <code>sleep</code> command after every type, just to make sure that it is not skipping because of fast execution.</p>
  
  <pre><code>;Run application
  Run("cmd.exe")
  
  ;Wait for CMD to be opened
  WinWaitActive("Administrator: C:\Windows\system32\cmd.exe", "", 15)
  
  ;Write some commands on cmd
  ControlSend("Administrator: C:\Windows\system32\cmd.exe", "", "Edit1", "cd\")
  Sleep(10000)
  Send("{Enter}")
  Sleep(10000)
  ControlSend("Administrator: C:\Windows\system32\cmd.exe", "", "Edit1", "cd C:\Program Files (x86)\Jenkins")
  Sleep(10000)
  Send("{Enter}")
  ControlSend("Administrator: C:\Windows\system32\cmd.exe", "", "Edit1", "jenkins.exe start")
  Sleep(10000)
  Send("{Enter}")
  </code></pre>
  
  <hr/>
  
  <p>I got the answer:</p>
  
  <pre><code>ControlSend("Administrator: C:\Windows\system32\cmd.exe", "", "", "cd C:\Program Files (x86)\Jenkins")
  </code></pre>
  
  <p>I needed to remove "Edit" , as cmd is not an editable window.</p>