Articles

Batch to dial multiple phone number

August 15, 2006 at 12:09:54
Specs: Windows/Dos, 512mb

On a daily basis, there is a list of error of phone numbers generated that I have to check on. The list is remote printers that we send data to that get turned off, run out of paper, etc.

By the time I get the list, it is several hours old, and many of the machines have been turned back on. The list of phone numbers is different every day.

What I want to do is create a batch file that will dial the numbers on my list one by one so I can just hear what the line does, maybe pause so I can note it down, then go on to the next number. I've looked for programs off the shelf for this, but they tend to be more involved than I need.

Ideally, I would like the phone numbers to be in a seperate file that could be generated daily.

It has been so long since I've written a batch file though, that 1/2 the commands seem to have left my brain! Help!

So far, I have:

@echo off
CLS
REM Argument to pull phone number
REM DIAL
echo Dialing %1
echo ATDT 9%1;COM1 REM 9 to dial out
echo Press any key to disconnect
PAUSE
echo ATH>COM1:
REM argument to go back to top and pull next number.
end

Any help would be MUCH appreciated.

Thanks,

Vanessa



See More: Batch to dial multiple phone number

Report •


#1
August 15, 2006 at 12:28:54

You could use dialer.exe in a FOR loop.

@echo off
set path=c:\path\to\dialer.exe\
for /f %%a in (phone_numbers.txt) do dialer %%a

That should work, but I can't test it right now. I'm not sure of the exact path to dialer.exe, but I think it might be \Program Files\Communications\

There's no place like 127.0.0.1

Visit my site Back Slash


Report •

#2
August 15, 2006 at 21:04:35

Hi Vanessa,

::==
echo ATDT 9%1;COM1 REM 9 to dial out
echo Press any key to disconnect
PAUSE
echo ATH>COM1:
::==

Should work. I assume the semicolon in the ATDT line is a typo.

Not obvious what sort of file you need to pull the phone nums from. Before we get much further, let's get clear about what version of "windows/DOS" we're talking about.

=======================
Hi Tony,

Probably best to avoid altering the path.

The dialer I have is:

c:\Program Files\Windows NT\dialer.exe

which brings up a window.


If at first you don't succeed, you're about average.

M2


Report •

#3
August 16, 2006 at 08:49:52

I'm using Windows 2000. I'd like to be able to pull from a text file. Something I could copy and paste my numbers into.

Tony, thanks for the suggestion! I tried it, but I kept getting the error:
'dialer' is not recognized as an internal or external command, operable program or batch file.

So, I tried modifying it slightly, and got:
'dialer.exe' is not recognized as an internal or external command, operable program or batch file.

M2, yes that is a typo - thanks for catching that. That part does work, but I still want it to pull from a list of phone numbers. I'm not sure how to get it to increment through the numbers.



Report •

Related Solutions

#4
August 17, 2006 at 03:09:40

If the text file is a list of phone nums, one per line:
::=========================================
for /f "tokens=*" %%N in (thelist.txt) do (
call :sub1 %%N )
goto :eof

:sub1
:: your code to dial goes here
:: if there are spaces in the number string, change %1 to %*
goto :eof
::==========================================


If at first you don't succeed, you're about average.

M2


Report •

#5
August 17, 2006 at 03:18:18


:sub1 %%N
:: your code to dial goes here
:: if there are spaces in the number string, change %1 to %*
goto :eof
::===

uli


Report •

#6
August 17, 2006 at 03:35:22

Hi uli,

You lost me there.


If at first you don't succeed, you're about average.

M2


Report •

#7
August 17, 2006 at 04:23:55

Hi M2,

you were just a bit quicker than me, so I read your solution and stumbled over the sub. :-)

Uli



Report •

#8
August 17, 2006 at 08:47:09

Thank you so much!!

I'm refining my code a bit to work a little more along the lines of how I want, but it sequences through the numbers perfectly. I can just paste the numbers in that way, and work on something else while my computer does the tedious part.

Thanks again!!


Report •

#9
August 17, 2006 at 13:37:26

Hey M2, I got a couple questions about your script.

What do these two lines of code do?

echo ATDT 9%1;COM1 REM 9 to dial out

echo ATH>COM1:

Are those HypeTerminal commands?

I understand the REM's and ECHO's of course, but what does ATDT 9%1;COM1 and ATH>COM1 do?

There's no place like 127.0.0.1

Visit my site Back Slash


Report •

#10
August 17, 2006 at 14:38:12

Those lines are sending commands [the world-famous Hayes AT set] to COM1, where the modem presumably is.

ATDT means dial using tone. The 9 gets her an outside line. The %1 [or %*] outputs the ph num.

ATH hangs up.


=====================================
If at first you don't succeed, you're about average.

M2



Report •

#11
August 17, 2006 at 15:00:54

Alright, thanks for clearing that up.

There's no place like 127.0.0.1

Visit my site Back Slash


Report •


Ask Question