1

I am trying to execute ls command through busybox. I am creating a .bat file to execute this command which i am calling through .java

However, i am not able to execute commands one after another in .bat file.

This is the contents of my .bat file

"C:\Documents and Settings\Some Directory\Android\android-sdk\platform-tools\adb.exe" shell
/data/busybox/busybox ls

what i think that once i start the shell through the first line of my .bat, the control from the shell is lost hence second command is not executed. Because if i write my .bat file as

"C:\Documents and Settings\Some Directory\Android\android-sdk\platform-tools\adb.exe" shell ls

it works fine.

I need to write commands in my .bat file so that they exceute one after the another. I have tried using CALL before each commands in .bat, still it does not work. I have tried to use multiple .bat, still a fail cause.

Can someone please help me on this?

Thanks a ton.

Sirko
  • 72,589
  • 19
  • 149
  • 183
Parul S
  • 300
  • 1
  • 3
  • 10

1 Answers1

0

I am unable to test this myself with ADB at this moment, but this works for other programs that have an input buffer. I will try to verify this tonight, but if anyone else confirms it before then, leave a comment.

@echo off

(   echo shell
    echo /data/busybox/busybox ls
) | adb.exe
David Ruhmann
  • 11,064
  • 4
  • 37
  • 47