Error 800A01CE, add printer by vbs throught ip

303 Views Asked by At

When I tried a small code to add printer on window 10 enterprise 64bits. I meet error 800A01CE. Please help me to resolve this problem. This is my source

Option Explicit
Dim strPrinterUNC, objNetwork 

strPrinterUNC = "\\10.95.200.11\HP LaserJet 400" 

Set objNetwork = createObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection strPrinterUNC
objNetwork.SetDefaultPrinter strPrinterUNC 

Set objNetwork = Nothing
MsgBox ("Add printer successfully")

My error as image.

I tried change strPrinterUNC manytime, but I still got the error above. Please suggest me the way to custom my code. Thank you,

0

There are 0 best solutions below