How to determine the printer port?

Discussion in 'Windows Vista Drivers' started by Tim D, Sep 27, 2004.

  1. Tim D

    Tim D Guest

    How can I determine the port that a printer is connected to? For example
    during a printer driver installation program I want to be able to determine
    if the printer is connected to LPT1 or USB004 or whatever parallel or usb
    port the particular printer that is being installed may be connected to.
    Also, if a "Virtual printer port for USB" is not already created for the
    printer then create one.

    Any ideas?

    Thanks!
     
    Tim D, Sep 27, 2004
    #1
    1. Advertising

  2. Tim D

    Matt Kane Guest

    EnumPrinters with the appropriate flags and level = 2
    OR
    GetPrinter with level 2 if you already have a handle to it.
    "Tim D" wrote:

    > How can I determine the port that a printer is connected to? For example
    > during a printer driver installation program I want to be able to determine
    > if the printer is connected to LPT1 or USB004 or whatever parallel or usb
    > port the particular printer that is being installed may be connected to.
    > Also, if a "Virtual printer port for USB" is not already created for the
    > printer then create one.
    >
    > Any ideas?
    >
    > Thanks!
     
    Matt Kane, Sep 27, 2004
    #2
    1. Advertising

  3. Tim D

    Tim D Guest

    I failed to mention that the printer is not installed yet. This is a
    driver/printer installation program.

    I found out that using UpdateDriverForPlugAndPlayDevices will work to
    install the printer on whatever port it is connected to and so I don't really
    need to know what port using this method. After the printer is installed your
    method would work fine, thanks for the info.

    "Matt Kane" wrote:

    > EnumPrinters with the appropriate flags and level = 2
    > OR
    > GetPrinter with level 2 if you already have a handle to it.
    > "Tim D" wrote:
    >
    > > How can I determine the port that a printer is connected to? For example
    > > during a printer driver installation program I want to be able to determine
    > > if the printer is connected to LPT1 or USB004 or whatever parallel or usb
    > > port the particular printer that is being installed may be connected to.
    > > Also, if a "Virtual printer port for USB" is not already created for the
    > > printer then create one.
    > >
    > > Any ideas?
    > >
    > > Thanks!
     
    Tim D, Sep 28, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Will

    How Do I Determine The Serial Port In Use?

    Will, Apr 17, 2008, in forum: Windows Vista Hardware
    Replies:
    1
    Views:
    381
  2. siedem

    What determine COM port number?

    siedem, Feb 19, 2004, in forum: Windows Vista Drivers
    Replies:
    4
    Views:
    589
    Walter Oney
    Feb 20, 2004
  3. Adam
    Replies:
    22
    Views:
    1,449
  4. LMI
    Replies:
    4
    Views:
    201
    Terry
    Sep 20, 2005
  5. Paul Bergson [MVP-DS]

    Re: How to Determine Which Service in LSASS.EXE Binds to Port X?

    Paul Bergson [MVP-DS], Sep 27, 2007, in forum: Active Directory
    Replies:
    9
    Views:
    834
    Paul Bergson [MVP-DS]
    Oct 8, 2007
Loading...

Share This Page