473,387 Members | 1,495 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Need to programmatically install a local printer.

Can anyone give me some guidance on installing a local printer with VB 2005?
I'm guessing I would probably do this with WMI, but i'm not finding anything
obvious. I see how to add a networked printer, but nothing to add a local
printer, assign it a port & driver.
Feb 6 '07 #1
2 8489
Is the driver already installed or do you need to silently run the driver
installation too?

I have used WMI to clear print queues,set default printer, enum printers,
installed network printers, but never to install one locally.

Don't see why you need a program to do it anyway if its a local printer
being as you will plug it all in... & will be standing in front of the
machine anyway

Don't see any point of your application

Unless its on a parallel port you won't need to select a port to use because
I guess it'll be a USB connection automatically be picked up by the OS

Maybe your best option is to look on the Microsoft Scripting website because
I am sure there's a VBS on ther for what you require

Here's a WMI Code Creator which lists the Printer classes & you can set it
to VB.NET. Maybe there is something in there:

http://www.microsoft.com/downloads/d...DisplayLang=en

Here's your best bet: <------------------- Best bet

http://www.microsoft.com/technet/scr....mspx?mfr=true

Script Center Tools:

http://www.microsoft.com/technet/scr.../createit.mspx

Script Center Homepage:

http://www.microsoft.com/technet/scr...r/default.mspx

--
Newbie Coder
(It's just a name)
Feb 6 '07 #2
There is a point...

A label printer is already installed. I need to edit the label printer
instance to print to a file. Then I need to install a temporary printer to
print to the label printer. This way I can use FileSystemWatcher to watch
for a printer file, edit it, and send it out to the printer.

My program needs to edit the existing printer and install the temporary
printer when it opens. It needs to remove the temporary printer and edit the
existing printer back to its original port when the program closes. This
allows the printing to resume normal operations when my program is not
running.
"Newbie Coder" <ne*********@spammeplease.comwrote in message
news:us**************@TK2MSFTNGP04.phx.gbl...
Is the driver already installed or do you need to silently run the driver
installation too?

I have used WMI to clear print queues,set default printer, enum printers,
installed network printers, but never to install one locally.

Don't see why you need a program to do it anyway if its a local printer
being as you will plug it all in... & will be standing in front of the
machine anyway

Don't see any point of your application

Unless its on a parallel port you won't need to select a port to use
because
I guess it'll be a USB connection automatically be picked up by the OS

Maybe your best option is to look on the Microsoft Scripting website
because
I am sure there's a VBS on ther for what you require

Here's a WMI Code Creator which lists the Printer classes & you can set it
to VB.NET. Maybe there is something in there:

http://www.microsoft.com/downloads/d...DisplayLang=en

Here's your best bet: <------------------- Best bet

http://www.microsoft.com/technet/scr....mspx?mfr=true

Script Center Tools:

http://www.microsoft.com/technet/scr.../createit.mspx

Script Center Homepage:

http://www.microsoft.com/technet/scr...r/default.mspx

--
Newbie Coder
(It's just a name)


Feb 6 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mike | last post by:
I have a win2K server that runs my web sites. I need to use ASP.net on one of my sites. I am just learning about ASP.net and found that I cannot run ASP.net formated pages on my server the way...
1
by: Richard Johnson | last post by:
I am a C++ newbie and am trying to send simple text data to my local printer. My printer is a USB printer and I have tried the following code using my USB port. This code executes but does not send...
0
by: Sneid | last post by:
Hi I explain my title: i'm actually developping an application for privilege-limited users. They all have a laptop, and are not local administrators of the machine I 'm developping a program...
1
by: kishore kumar via DotNetMonster.com | last post by:
hi I want to know the print queue details for local printer and how many jobs r there in print queue. plz help me -- Message posted via http://www.dotnetmonster.com
2
by: Mike | last post by:
I posted this to a general asp newsgroup and was referred here..... I have a win2K server that runs my web sites. I need to use ASP.net on one of my sites. I am just learning about ASP.net and...
3
by: carlor | last post by:
Hi there, Our client has a requirement to print labels from the web site to a local printer. i.e. user logs onto web site and click a print button and the address is printed to a label printer...
3
by: Steve | last post by:
Hi All I have a Windows forms POS program and have windows xp printer drivers for the Posiflex printers the customers use Is it possible to automatically install a windows printer driver (and...
5
by: jdugal | last post by:
Guys, I am using Windows XP Pro (SP1) and suddenly my printers (local & network) have disappeared from the Printers & Faxes menu. If I try to re-install any printer I get an error message...
0
by: =?Utf-8?B?RGVs?= | last post by:
Hello I need help I have a 1998 hp and have installed windows xp I can't seem to install a printer driver to make my computer communicate with my old hp 722c printer..I've installed the ones from...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.