Solved

About LPT port capture

Posted on 1998-01-02
8
485 Views
Last Modified: 2008-02-01
Hello
I need see the printers in an PC and capture a port for connect to this printers. Under Win95 and Windows NT.
In other words:
How to capture an LPT port and how to see what printers have shared another computer?
Thanks and regards
0
Comment
Question by:amanuelx
  • 6
  • 2
8 Comments
 
LVL 8

Accepted Solution

by:
mrmick earned 300 total points
ID: 1448789
You can enumerate through the connected printers with this:

Dim P as printer
For each P in printers
   debug.print p.name
Next

0
 
LVL 8

Expert Comment

by:mrmick
ID: 1448790
Whoops, that's

Dim P as Printer

For Each P in Printers
  Debug.Print P.DeviceName, P.DriverName, P.Port
Next
0
 
LVL 8

Expert Comment

by:mrmick
ID: 1448791
What do you mean by "capture an LPT Port"?

To enumerate the printers available on the network that are shared but NOT connected.  You can use the API function:

WNetEnumResource


0
 

Author Comment

by:amanuelx
ID: 1448792
Well, i can see the printers availables if i before select it.
I need too see the other pc's and see if they have any printer shared.
i need then assign my lpt1 port to any of these printers, and then (once used) deassign this lpt1 port.
Tx
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 8

Expert Comment

by:mrmick
ID: 1448793
This is a little more complicated, If you'd like, I'll write you an example of enumerating all available shared network printers on the network, and an example of how to connect to and disconnect from a network resource.

If this is acceptable, provide your email address so I can send you the sample project.  Also, you must agree to give me credit for the answer to this question once I've provided the examples.
0
 

Author Comment

by:amanuelx
ID: 1448794
Ok, if i can assign my lpt1 to any printer of these, OK !
Regards
0
 
LVL 8

Expert Comment

by:mrmick
ID: 1448795
It's a deal, What's your email address?
0
 
LVL 8

Expert Comment

by:mrmick
ID: 1448796
If you prefer, you can email it to me at mick@owen.wa.com
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now