473,714 Members | 2,527 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Automatic printer installation/creation

Is there a way from within a C# app to create a printer? I am looking to
automate the creation of (possibly) dozens of printers, to prevent having to
go through the "Add Printer Wizard" so many times. The app will have
access to all the info necessary as if "Add Printer Wizard" was being used, I
just need to know if there's an elegant way to do this (short of nasty
registry hacks).
May 11 '07 #1
2 3707
I am trying to do the same thing. I have searched the web extensivly and came
up with two examples:
http://www.developerfusion.co.uk/show/5450/2/
http://www.thescripts.com/forum/thread223709.html

they compile without errors but when I try to accually use them they both
come up with a generic error (that is of no help figuring out what is causing
the error).

"ReynoldsUs er" wrote:
Is there a way from within a C# app to create a printer? I am looking to
automate the creation of (possibly) dozens of printers, to prevent having to
go through the "Add Printer Wizard" so many times. The app will have
access to all the info necessary as if "Add Printer Wizard" was being used, I
just need to know if there's an elegant way to do this (short of nasty
registry hacks).
May 16 '07 #2
Thanks for the reply - I think we have actually got this working now here.
We are using the Interop services, and making an API call (AddPrinter) to do
what we want. We found some additional information here:
http://www.printdistributor.com/forum/post/121

The structures referenced are explained here:
http://msdn2.microsoft.com/en-us/library/ms536023.aspx
and
http://msdn2.microsoft.com/en-us/library/ms535509.aspx

I was also able to do the reverse, namely delete the printer that I
previously created, by using the DeletePrinter function. Good luck.
"David Hogenkamp" wrote:
I am trying to do the same thing. I have searched the web extensivly and came
up with two examples:
http://www.developerfusion.co.uk/show/5450/2/
http://www.thescripts.com/forum/thread223709.html

they compile without errors but when I try to accually use them they both
come up with a generic error (that is of no help figuring out what is causing
the error).

"ReynoldsUs er" wrote:
Is there a way from within a C# app to create a printer? I am looking to
automate the creation of (possibly) dozens of printers, to prevent having to
go through the "Add Printer Wizard" so many times. The app will have
access to all the info necessary as if "Add Printer Wizard" was being used, I
just need to know if there's an elegant way to do this (short of nasty
registry hacks).
May 16 '07 #3

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

Similar topics

3
8968
by: CH3 | last post by:
Hi, I've not done any programming for years, but I would like to write a simple program/script to help with something at work. We have several print servers for our 2000+ users, and whenever we have to rebuild a user profile we have to add the printers to this profile. The printers are on all print servers for built in redundancy, but it's a pain having to add each one several times. I want to write a simple program so that you enter the...
0
3087
by: Rob | last post by:
I'm having a problem with the printer for a program I've created. I have to recreate a data table on a page to be printed. Earlier today it worked fine; however, I am now having an odd problem: every time I execute the Printer.Print command, it the program spools the print job. Restarting my computer did not help. According to everything I've been reading all afternoon, this should not happen. The .Print command simply should draw the text...
2
1895
by: GMane Python | last post by:
Anyone know if there's a module which will allow me to 'create' windows printer definitions? Not from a Windows domain network, but just to add a printer that sends to a jet-direct-attached printer. Thanks! Dave
6
7584
by: PW | last post by:
I have an electronic cash drawer as part of a point-of-sale installation. You're supposed to be able to automatically open the cash drawer with some printer commands (drawer is connected to the receipt printer) but I can't get it to open automatically. I want it to open when the customers receipt is printed. How do you send printer escape sequences to a windows printer via ASP ? The cash drawer model is ... Posiflex CR-4100 Cash Drawer
1
1802
by: yongsing | last post by:
I wanted to install DB2 client on a Redhat Linux 9 system so that I can run Java programs to access a remote DB2 V7.2 database. So I installed DB2 EE v7.1 on the system, selecting only the Administration Client and Development Client. The installation is successful, except that the instance creation failed. Now what can I do after the installation? Unlike the Windows platform, no DB2 menu items appear on the main menu.
0
7913
by: coolsilver.net | last post by:
I am not sure if I am in the right group. My problem is this: My VB.NET application prints to the Epson printer using Epson OPOS drivers. I have downloaded the Epson ADK for .NET from the EpsonExpert site (www.epsonexpert.com) I have also downloaded the Epson Advanced Printer Driver from the Epson site. I have installed Microsot POS for .NET on a windows 2000 machine. The installation completes but it throws an error "Error 5008....
2
8540
by: Terry Olsen | last post by:
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.
58
4665
by: Jorge Peixoto de Morais Neto | last post by:
I was reading the code of FFmpeg and it seems that they use malloc just too much. The problems and dangers of malloc are widely known. Malloc also has some overhead (although I don't know what is the overhead of automatic variable sized arrays, I suspect it is smaller than that of malloc), although I'm not too worried about it. I was thinking that, with C99's variable length arrays, malloc shouldn't be needed most of the time. But I'm...
0
8796
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8704
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9307
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9009
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7946
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6627
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4715
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3155
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2105
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.