I
I
Illia Pidvalnyi2021-06-22 09:49:58
cmd/bat
Illia Pidvalnyi, 2021-06-22 09:49:58

How to run a loop in .bat?

I had a need to run several remote videos on Andriod TV. I found a way to do this, and now I'm writing a .bat script to run several things at once. Commands by themselves work, but in a for loop they don't. I'm sure there's some dumb bug that I don't understand yet. Please tell me what is wrong.

The code:

@ECHO OFF
ECHO START!

set "ip_list=192.168.0.32:5555 192.168.0.60:5555 "

for %%ip_iter in (%ip_list%) do (
 
    adb connect %%ip_iter
    adb -s %%ip_iter shell am start -a android.intent.action.VIEW -d /storage/self/primary/Movies/testm/testvideo.mp4 -t video/mp4
    adb disconnect %%ip_iter

)

ECHO COMPLETE!
PAUSE

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question