WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Printing Information

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Seeing all Connected Persistent Network Printers

Keywords:   Connected Persistent Network Printers	 wntResources2

Question:

I am trying to complete an inventory of every users PC in our company nationwide. I chose WinBatch so that I did not have to fly to a dozen cities and take an inventory of every PC. So far the inventory app that I created using WinBatch has been wonderful! My back is turning red from all the slaps on the back! Thanks for an EXCELLENT product!

My problem is that I am attempting to read the users "persistent network printers." I don't want to know what printers they are temporarily using. Another problem is that we have 20 domains. No one is in the same domain at every sight. All domains are available from all sights. WAIT! It gets worse. There is not just one print server per domain, there could be an additional 20 print servers on any domain. It gets worse as the company grows as there is no focus on IS cooperation.

What I would like to do is generate a list of all printers the user is connected to on the network. I have tried the wntResources and wntResources2 functions. Both work great when viewing all printers in a specific domain and specific printer server. I have tried the following command:

   printers = wntResources2("", 1, 2, 3, "")
I am given a blank dialog box listing no connections.

I am running both Windows 95 and Windows NT PCs on a WinNT network. Any ideas?

One last time, thanks SO MUCH for a great LIFE-SAVING product. I feel that I am at cause over my PC, not an effect of my PC. You're Tech Support is wonderful and I can't ever stop bragging about my new found abilities from your product. Hey, people are calling me "The WinBatch Man." Got any T-shirts I could wear? :)

Answer:

You'll probably get the info faster by looking at the registry
   HKCU\Software\Microsoft\WindowsNT\Current Version\PrinterPorts\ 
contains a list of Printer UNCs used,
   HKCU\Software\Microsoft\Windows NT\Current Version\Network\Persistent Connections\ 
contains a list of share UNCs. The path for 95 is similar.

NB: To see non-persistent Printers connected and what system and printer name it is, you might be able to poke around in the win.ini file to see that it says in the printer section. And/or DiskScan will tell you the network drives connected. Process that in a for loop (using ItemCount and itemExtract) to pull each drive out one at a time, and feed the drive to the wntGetCon function to see what it is mapped to.


Article ID:   W13704
Filename:   Seeing Persistent Network Printers.txt
File Created: 1999:04:15:16:55:48
Last Updated: 1999:04:15:16:55:48