469,646 Members | 1,567 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,646 developers. It's quick & easy.

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 8051
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Richard Johnson | last post: by
1 post views Thread by kishore kumar via DotNetMonster.com | last post: by
2 posts views Thread by Mike | last post: by
3 posts views Thread by carlor | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.