Share Printer

kadara

New member
Joined
Mar 15, 2013
Messages
3
Programming Experience
Beginner
Hi,

I'm relative new in vb.net programming, so I have some questions about printer settings, printer properties.
How could I share a local printer? Also I would like to access another PC and share a printer installed on that computer. How could I do that?
Thanks for your help?

I used the following vbscript code, but I can't convert it in vb.net:

strComputer = "w20hy050"

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

'Set colInstalledPrinters = objWMIService.ExecQuery _
' ("Select * from Win32_Printer Where Network = FALSE")

Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * from Win32_Printer Where Name = 'Customer'")

For Each objPrinter in colInstalledPrinters
objPrinter.Shared = TRUE
objPrinter.ShareName = "Customer"
objPrinter.Put_
Next
 
Last edited:

Latest posts

Back
Top