title: Batch file commands and using command prompt to accomplish this
body: <p>Couple of questions, with all of them regarding batch code.</p>
  
  <p>So my first question is that if I have a batch file, and it has commands in it, how would I do something like this in command prompt?</p>
  
  <pre><code>cd C:\User\username\Desktop\folder\
  </code></pre>
  
  <p>And in folder, there is a file called <code>CMDTEST.bat</code>. With this, I would want to use commands from there. In this file, it starts off by giving me a few choices. There are three, which are selected by typing <code>i</code>, for input, <code>o</code>, for output, a for ADB connection, and <code>q</code> for quit. My question is, how would I do something like this?</p>
  
  <pre><code>C:\Users\username\Desktop\folder\CMDTEST.bat -i
  </code></pre>
  
  <p>The goal of typing something like this, is it would directly go to the <code>CMDTEST.bat</code> file, and then execute the choice if 'i' was put in. Similarly, there would something for 'o', something for 'a', and something for 'q'. How would I go about accomplishing this?</p>
  
  <p>My second question is how do I get the directory of a connected USB device? In my case, I have to get the directory of a connected tablet, which has files on it. I need to make all this run pretty quickly, so I need the directories with a simple command, like if I did the same thing as the above code block, but something like: </p>
  
  <pre><code>C:\Users\username\Desktop\folder\CMDTEST.bat -d
  </code></pre>
  
  <p>That would list all the usb devices connected, with their name as shown in Windows Explorer, and the path used to access the device. All of the devices would be android tablets, so theres no need for a root scheme or  anything to that extent.</p>
  
  <p>The third and final question I have is how would I check in an if statement, whether things were printed in a cmd Android ADB statement where I write:</p>
  
  <pre><code>C:\Users\username\Desktop\platform-tools(this is where the Android SDK is stored)
  </code></pre>
  
  <p>and then I would write </p>
  
  <pre><code>adb devices
  </code></pre>
  
  <p>which would print all available devices connected(all android devices). How would I check if things are printed from that, and if they ARE NOT, then continue to search for them in a loop, until at least one device is found, then when it is found, break out of the loop?</p>