EDN Admin
Well-known member
Hi
Have the following code to list all printers on chosen remote computerDim strComputer As String
Dim objWMIService, colPrinters, objPrinter As Object
strComputer = tbPCNAME.Text
objWMIService = GetObject("winmgmts:\" & strComputer & "rootcimv2")
colPrinters = objWMIService.ExecQuery("Select * From Win32_Printer")
For Each objPrinter In colPrinters
ListBoxPrinters.Items.Add(objPrinter.DeviceID)
Next
I now need to be able to delete a printer from the remote machine - but cannot see how to do it, a lot of sites mention using objPrinter.Delete but this only seems to work in vb script, not in VB.net
Any ideas please?
Darren Rose
View the full article
Have the following code to list all printers on chosen remote computerDim strComputer As String
Dim objWMIService, colPrinters, objPrinter As Object
strComputer = tbPCNAME.Text
objWMIService = GetObject("winmgmts:\" & strComputer & "rootcimv2")
colPrinters = objWMIService.ExecQuery("Select * From Win32_Printer")
For Each objPrinter In colPrinters
ListBoxPrinters.Items.Add(objPrinter.DeviceID)
Next
I now need to be able to delete a printer from the remote machine - but cannot see how to do it, a lot of sites mention using objPrinter.Delete but this only seems to work in vb script, not in VB.net
Any ideas please?
Darren Rose
View the full article