title: Shell commands in VB
body: <p>For some reason it seems that ampersands are not working like they should when I attempt to use them in shell commands in VB. When I attempt to link two commands together on the same line using an ampersand i receive the error: "filenotfoundexception was unhandled file not found"</p>
  
  <p>The command I am trying to run is: </p>
  
  <pre><code> Shell("cd " &amp; TextBox2.Text.ToString &amp; " &amp; adb -s " &amp; TextBox15.Text.ToString &amp; " shell monkey -p " &amp; TextBox1.Text.ToString &amp; " -v 1", AppWinStyle.Hide) 
  </code></pre>
  
  <p>I tried breaking it down to a more simplistic form, but im still receiving the error:</p>
  
  <pre><code> Shell("cd C:\ &amp; adb shell monkey -p com.android.system -v 1", AppWinStyle.Hide)
  </code></pre>
  
  <p>If I get rid of the ampersand and just use:</p>
  
  <pre><code> shell(adb shell monkey -p com.android.system -v 1", AppWinStyle.Hide)
  </code></pre>
  
  <p>everything works just fine. Are ampersands not available in vb shell commands? </p>
  
  <hr>
  
  <h2>*My edit</h2>
  
  <p>Actually I am still having trouble. So what i have is:</p>
  
  <pre><code>    psi.WorkingDirectory = TextBox2.Text.ToString
      psi.FileName = "adb"
      psi.WindowStyle = ProcessWindowStyle.Hidden
  </code></pre>
  
  <p>then I have a little bit of code, and then I assign an argument and execute the argument:</p>
  
  <pre><code>    psi.Arguments = "-s " &amp; TextBox15.Text.ToString &amp; " shell monkey -p " &amp; TextBox1.Text.ToString &amp; " -v  1"
      Process.Start(psi)
  </code></pre>
  
  <p>then I have a little bit of code, and then I try running the process again with a different argument:</p>
  
  <pre><code>    psi.Arguments = "-s " &amp; TextBox15.Text.ToString &amp; " shell input keyevent 3"
      Process.Start(psi)
  </code></pre>
  
  <p>First one seems to work, all the subsequent ones do not. Is there any reason why this shouldnt work? is there a process refresh or something that I am missing?</p>