Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


COM PORT

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,54429
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> COM PORT
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 COM PORT - 12/17/2007 7:21:57 PM   
  takeda kozo

 

Posts: 83
Score: 0
Joined: 11/9/2005
Status: offline
anyone know how to test to see if:

a) there is a device physically connected to a com port
b) if yes, what the device is called and what port numnber it's on


???

Thanks
 
 
Post #: 1
 
 RE: COM PORT - 12/18/2007 2:19:52 AM   
  ebgreen


Posts: 4972
Score: 31
Joined: 7/12/2005
Status: offline
Pretty sure this has been asked before. Did you search?

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to takeda kozo)
 
 
Post #: 2
 
 RE: COM PORT - 12/18/2007 10:22:23 AM   
  takeda kozo

 

Posts: 83
Score: 0
Joined: 11/9/2005
Status: offline
yes, I've searched a couple of times and can't find anything relevant

thus my question


(in reply to ebgreen)
 
 
Post #: 3
 
 RE: COM PORT - 12/18/2007 10:36:43 AM   
  dm_4ever


Posts: 2641
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
Have you tried WMI and the Win32_SerialPort class to see if it provides you the informaion you're looking for?

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to takeda kozo)
 
 
Post #: 4
 
 RE: COM PORT - 12/18/2007 10:44:41 AM   
  Meg


Posts: 126
Score: 2
Joined: 7/13/2006
From: Australia
Status: offline
I had a quick look at wmi and here is a copy and paste of some scripts that scriptomatic produced.

This one tells you the port name and the instance name


      

This one tells you the instance name + whether the port is busy + a few other things.


      

Marry up the instance name/ port name to report if the port is busy which is probably an indication that the port has something active connected to it. As far as determining what that device is good luck. Serial ports are not plug and play so even the GUI can't tell what is attached. If you were looking for a specific device like a modem you may be able to craft a script to send AT commands to determine what sort of modem is connected etc.

< Message edited by Meg -- 12/18/2007 10:47:29 AM >

(in reply to takeda kozo)
 
 
Post #: 5
 
 RE: COM PORT - 12/18/2007 11:06:10 AM   
  takeda kozo

 

Posts: 83
Score: 0
Joined: 11/9/2005
Status: offline
Hi Meg,

Thank you for your post. I will test this out and see how I go

I had a look through scriptomatic, but didn't even notice this "class"

Cheers ~

:-)

(in reply to Meg)
 
 
Post #: 6
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> COM PORT Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts