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: W13289Filename: Dialing a Modem.txt