Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

windows batch script not execute next line after "adb shell"

windows batch script:

adb shell
echo hello 

why does the next line echo hello not execute?

like image 411
ruby Avatar asked Jul 15 '26 10:07

ruby


1 Answers

The next line in a batch script executes after the previous command adb shell has finished.

adb shell starts an interactive shell and it finishes only after you exit the shell.

Assuming you want to execute echo hello in the adb shell, put them on the same line:

adb shell echo hello

In this form, adb shell doesn't start an interactive shell but operates in batch mode, running the command and then exiting.


any method can force next command execute even the pre command not finished ?

Use start to launch a program in the background, e.g.

start /b adb shell
echo hello
like image 183
laalto Avatar answered Jul 17 '26 23:07

laalto



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!