How to change COM port number

DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: How to change COM port number

  1. #1
    Join Date
    Feb 2006

    Question How to change COM port number

    I need to write a program in VB6 to list all of the available COM ports on a
    computer and allow the operator to change the COM port number. I can get the list of available COM ports using the WMI but how to I change the COM port number?

    I have to support a legacy program that looks for connections to devices on
    specific com ports. Genius that this original programmer was, he hard coded
    those com port numbers.

    Currently we use a Digi edgeport with 4 serial ports. The Edgeport comes
    with a utility that allows you to change the COM port numbers. However we
    would like to move to single USB to serial devices (serialized of course),
    which do not provide the same type of utility. I would like to write a VB6
    program to help with setup by allowing the user to connect a terminator to a
    serial port, send a message out to each available com port, and look for the
    response. Once the user identifies the serial port I want to allow them to
    change the com port number to one of the hard coded ports.

    Of course they could use the device manager to change the com port numbers but I wanted to make an automated, easy to use utility, since the users will not be computer savy.

    Any ideas?


  2. #2
    Join Date
    Apr 2004
    Lafayette, LA
    I have done this by changing settings in the registry, but it is tricky trying to do it on any just any computer. You have to find the entries for the specific controller and rename the port. The problem is that different controllers use different schemes for naming the ports. If you search the registry for a port name such as 'COM3' on a couple of different computers, you will see what I mean.
    I have control over the computers used within my company, so I can write code to perform this function. However, if you do not know which controller is used on all of the computers you need to access, then it is going to be difficult.
    There is also a COM port redirector utility that I saw at which allows you redirect streams from one com port to any other.

Similar Threads

  1. Help
    By George in forum oracle.general
    Replies: 0
    Last Post: 03-31-2003, 11:57 PM
  2. Help
    By George in forum oracle.general
    Replies: 0
    Last Post: 03-31-2003, 11:56 PM
  3. Change event reading info from database
    By Tommy in forum VB Classic
    Replies: 1
    Last Post: 10-29-2002, 08:52 PM
  4. Replies: 255
    Last Post: 02-13-2002, 07:32 PM
  5. WinSock port re-use - PLEASE HELP!!!
    By Mark Holder in forum VB Classic
    Replies: 4
    Last Post: 08-08-2000, 03:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center