How to install a printer using .NET?

I have a .INF for a virtual printer that I need to install from a .NET Application. I did this before using batch scripts, but I am looking for a piece of code for this in the .NET Framework.

There is nothing special about the .INF printer, so any code that installs the printer from INF in C # or VB.NET will work.

+5
source share
6 answers

I believe that this is possible due to interaction with the native win32 APIs, but I found it much simpler to simply use System.Diagnostics.Process () to call printui.dll via:

rundll32.exe printui.dll,PrintUIEntry /?

, script, : PrintUI.DLL

, . Windows, ( , - .INF, , ).

+9

WMI. . WMI Microsoft, , , .

+5

#

. , MS Platform SDK DLL PRNADMIN , , ..

Postscript. .

vbscripts, C:\Windows\system32\Printing_Admin_Scripts, :

http://technet.microsoft.com/en-us/library/cc771846.aspx

+2

not , , #/VB.NET.

-, , .

+1

API- , PINVOKE COM-.

0

All Articles