0
votes

I'm getting an error when I try to restore printer settings to a network printer. I can restore local printer settings. Works fine. If the network printer is not installed that will work also. I get an error of 0x0000000c when I attempt to restore settings to a UNC\Network Printer. Does anyone know why this is failing? Thanks!!

Part of my function.

If outputMethod = "Save in User Box" Then buildOutputCode = "07" End If

If outputMethod = "Save in User Box Print" Then buildOutputCode = "08" End If

WriteRegKey_Binary(model, printername, printertype, servername, "OutputMethod", "OutputMethodValue", buildOutputCode)

Dim binFile As String = My.Application.Info.DirectoryPath & "\printui\" & printername & ".dat"

If printerType = "Network" Then

printername = "\" & servername & "\" & printername

End If

if notInstalled = True then

Call Shell("RUNDLL32 PRINTUI.DLL,PrintUIEntry /in /q /n" & """" & printername & """" & "")

else

Call Shell("RUNDLL32 PRINTUI.DLL,PrintUIEntry /Sr /n" & """" & printername & """" & " /a " & """" & binFile & """" & " u ")

end if

1

1 Answers

0
votes

Found my problem! You can't use the share name of the network printer with the /Sr switch. You have to use the full printer name on the server.The SHARE NAME will work with the /Ss switch but not with the /Sr. Silly me!

Hey it works now!