[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Printer Model detection via Script on Windows 7

Posted on 2011-02-10
5
Medium Priority
?
641 Views
Last Modified: 2012-05-11
Hello!

I hope someone can help me achieve the following:

If you use the regular windows 7 add-printer routine from "Devices and Printers" and create a new port, then Windows can detect that printermodel and use an internal driver if available. I would like to know if I can perform that detection too using a script/commandline.

I'm building a HTA that provides the user with some basic local printer management features. The main reason for that is that the clients are migrating to a new trusted forest that doesn't have any published printqueues yet. This means that the standard Add printer from Directory isn't possible and there are many 1000's of shared printers in the environment so a little help there is required. Most printers are published in the printer resource forest(s) and can be resolved via IP in DNS too. This way I first determine the source-domains that a printer could be published in and the query that domain for that printQueue. If a published printer has been found I perform a connect network printer command and that all works fine, exept for those (few but incrasing number) printer-devices that have no Queue and should be setup as a local IP-port.

Right now I'll solve it by providing the users with a list of locally available drivers to choose from and then create the IP port and install the printer based on the selected driver, but I'd like to make it automatic.

I hope my story makes sense and someone can assist.

Thanks in advance.
Eric
0
Comment
Question by:evegter
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 8

Expert Comment

by:Toxacon
ID: 34865156
Use prnmngr.vbs which is comes with the OS. It can print the driver name which usually is the model as well. Other printer-managing scripts can be found in c:\Windows\System32\printer_admin_scripts\en-us.
0
 

Author Comment

by:evegter
ID: 34866826
Hello Toxacon,
thanks for your comments. I know of (and use) these default windows scripts and use parts of their code in my current HTA scripts. The scripts allow me to install ports, drivers, printers and share/publish them, all great, but the script does not 'scan' the remote IP-address to detect the printer I'm trying to install. As far as I know I can only install a 'local' printer by specifying the name of the printer identical to how it's written inside an INF file and specify the port to connect the printer to. It doesn't have an option to act like it does via the Add Printer GUI that performs a hardware detection...

I'll look further into it tomorrow and post comments.

Rgds,
Eric
0
 
LVL 8

Accepted Solution

by:
Toxacon earned 1500 total points
ID: 34868798
Then the easiest way could be using SNMP. Here's some help to use it from your own software or scripts:

http://www.codeproject.com/KB/cs/SNMPDLL.aspx
0
 

Author Comment

by:evegter
ID: 34868962
thanks Toxacon! I don't think that I can introduce a custom dll very easily here, but at least you put me into the right direction and I'll dig into the snmp-discovery procedure.

Rgds,
Eric
0
 

Author Closing Comment

by:evegter
ID: 34868969
it wasn't an exact solution, but the idea that was proposed did help me to find another approach for my problem.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
There are many software programs on offer that will claim to magically speed up your computer. The best advice I can give you is to avoid them like the plague, because they will often cause far more problems than they solve. Try some of these "do it…
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

650 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