mcmoser
asked on
Removing printer from Remote PC
Hello,
Thanks to another user here, i'm now able to get a listing of the printers installed on a remote pc by using:
Set objLocator = CreateObject("WbemScriptin g.SWbemLoc ator")
Set objWMIService = objLocator.ConnectServer(R emoteCompu ter, "root\cimv2", RemoteUsername, RemotePassword)
objWMIService.Security_.im personatio nLevel = 3
Set PrinterList = objWMIService.ExecQuery("S elect * from Win32_Printer")
For Each PrinterInstance In PrinterList
lstPrinters.AddItem PrinterInstance.Name
Next
Set PrinterList = Nothing
Set WMIService = Nothing
Now I would like to be able to remove a printer from that that workstation. Is it possible? As it is, I can use a dos command to accomplish what I want, but I would like to skip it if possible.
Thanks
Thanks to another user here, i'm now able to get a listing of the printers installed on a remote pc by using:
Set objLocator = CreateObject("WbemScriptin
Set objWMIService = objLocator.ConnectServer(R
objWMIService.Security_.im
Set PrinterList = objWMIService.ExecQuery("S
For Each PrinterInstance In PrinterList
lstPrinters.AddItem PrinterInstance.Name
Next
Set PrinterList = Nothing
Set WMIService = Nothing
Now I would like to be able to remove a printer from that that workstation. Is it possible? As it is, I can use a dos command to accomplish what I want, but I would like to skip it if possible.
Thanks
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
I get network connection does not exist when i use that @
Net.RemovePrinterConnectio
This looks to be a hard thing to do.