Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
zairyaab
- Posts: 1
- Joined: 01 Oct 2014 14:56
#1
Post
by zairyaab » 01 Oct 2014 15:06
Hi,
I use the following command from CMD Prompt to send a text message through the ABD and phone connected to the machine.
I am looking to replace the number with a list of numbers in text file. Not sure how would it be executed through a batch file. Can someone please help. Thanks.
Code: Select all
adb shell am startservice -e sms_number "0123456789" -e sms_body "SMS TEXT HERE" -n
com.companyname.companyservice/com.companyname.services.SMSSendService
Any help would be highly appreciated.
Thanks
-
foxidrive
- Expert
- Posts: 6031
- Joined: 10 Feb 2012 02:20
#2
Post
by foxidrive » 01 Oct 2014 20:16
One phone number per line in a plain text file:
Code: Select all
@echo off
for /f "usebackq delims=" %%a in ("file.txt") do (
adb shell am startservice -e sms_number "%%a" -e sms_body "SMS TEXT HERE" -n com.companyname.companyservice/com.companyname.services.SMSSendService
)
pause