Automating adb commands is there a way to run adb shell commands via windows? 

I would like to run a batch script such as this

adb shell 
mount -o rw,remount /system
exit


Currently when i run the batch script it only runs the first command adb shell
Wrong syntax :)

adb shell "mount -o rw,remount /system"


would do in your case (i.e. passing the command you want to run on the device to adb shell in double-quotes; the "exit" is not needed here as it is "implied"), provided your device's ADB daemon runs in root mode. You can even run multiple commands at once this way, e.g.:

adb shell "mount -o rw,remount /system &amp;&amp; echo 127.0.0.1 foobar.com &gt; /system/etc/hosts &amp;&amp; mount -o ro,remount /system"


Commands connected with &amp;&amp; here, meaning: only execute the next command if the previous one succeeded. If you don't want that dependency, use ; instead to connect them.

For how to use a multi-line command (so called "HEREDOC") with Windows (or any other OS), SuperUser is the better place to ask (in case the Wikipedia entry is not sufficient ;)