Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Com Port or Modem controls 1

Status
Not open for further replies.

timgerr

IS-IT--Management
Jan 22, 2004
364
US
Can anyone direct me to a component (free :) that would allow me to run a script that connects to the modem on my computer and sends data to another modem. I just need to send the data, that is all. The data is a sequence of numbers.

Thanks
Timgerr
 
I would research the MSCOMMLib.MSComm object.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Can you use mscomm in a vbscript? If so where can I mscomm?

Timgerr
 
That was where can I get the MSComm object?

Thanks
Tim
 
It should already exist (I think the file is mscomm32.ocx) on any standard windows install.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Can this object be used in a VBScript? I see a lot of information on .net but not VBScript.

Thanks,
Timgerr
 
Untested, but try something like this:
Code:
Set com_port = CreateObject("MSCOMMLib.MSComm")
com_port.commport = 2
com_port.settings = "9600,N,8,1"
com_port.InputLen = 1024
com_port.RThreshold = 0
com_port.RThreshold = 0

com_port.PortOpen = True

com_port.Output ="ATI6" & vbcrlf

msgbox "arbitrary delay"

msgbox com_port.Input
msgbox com_port.Input
msgbox com_port.Input

com_port.PortOpen = False

I found this by simply searching for 'vbscript modem' on Google. It is the first piece of code I came accross, so I'm sure there is more out there if you look for it.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Yea I saw that, not much else. I am trying to find some scripts to work against. I do not know how to send information, like a number to dial.

Timgerr
 
I won't be much help with actual vbscript, I'm just trying to learn it myself, but it appears to me that in the above you need to send the modem AT commands. Lookup your modem's command refrence (it's probably something like atdt 111-111-1111).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top