WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Modems and Dial-up Networking

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Dialing a Modem

Keywords:        dial modem phone wbt com

To dial your modem with WinBatch:

Note: Usually our Serial Extender or possibly, the Winsock, or WinInet Extenders are recommended for this kind of stuff. But if all you need to is dial a phone.... this works.

 ;phondial.wbt

 DaPort="COM1"                       ;Pick the comm port

 WinActivate("Notepad")

 SendKey("^{INS}")                   ;Copy text to clipboard

 DaNumber=ClipGet()                  ;Retrieve the text

 BoxOpen("Dialing %DaNumber%","Press H to hang up.  Press R to redial.")

 :Redial

 DaCall=FileOpen("COM1","WRITE")     ;Open the port then write the dial string

 Callem=FileWrite(DaCall,StrCat("ATDT",DaNumber)) ;Use ATDP if pulse dial

 Waiting=WaitForKey("H","R","","","")

 ;Callem=FileWrite(DaCall,"ATH0")    ;Line not needed on my system as the next

 FileClose(DaCall)                   ;closes the port and hangs up for me

 If Waiting==2 Then Delay(2)

  Then BoxTitle("ReDialing %DaNumber%") ;Busy? No Answer? Try again

  Then GoTo Redial

Article ID:   W13289
Filename:   Dialing a Modem.txt
File Created: 2001:01:15:15:12:20
Last Updated: 2001:01:15:15:12:20