"RUNDLL32 PRINTUI.DLL,PrintUIEntry /Sr /n... Operation could not be completed (error 0x0000000c)

StackOverflow https://stackoverflow.com/questions/17364824

Domanda

I stored my printer settings in a .dat file with this command:

RUNDLL32 PRINTUI.DLL,PrintUIEntry /Ss /n "SATO CG408" /a "c:\INI\small-tag.dat

I'm then trying to restore the printer setting in VB.net with this command (passing in my ini values).

Call Shell("RUNDLL32 PRINTUI.DLL,PrintUIEntry /Sr /n " & """" & My.LabelPrinter & """" & " /a " & """" & My.MediumTag & """")

I get the following error: Operation could not be completed (error 0x0000000c).

It works on my developer machine but when I install the application on a client's computer it comes up with that error. Any ideas?

È stato utile?

Soluzione

I figured it out. I need to use the existing driver on the client's computer. So the command would use the " u " flag.

Call Shell("RUNDLL32 PRINTUI.DLL,PrintUIEntry /Sr /n " & """" & My.LabelPrinter & """" & " /a " & """" & My.SmallTag & """" & " u ")

Altri suggerimenti

Try this:

RUNDLL32 PRINTUI.DLL,PrintUIEntry /Ss /n "SATO CG408" /a "c:\INI\small-tag.dat d g

RUNDLL32 PRINTUI.DLL,PrintUIEntry /Sr /n "SATO CG408" /a "c:\INI\small-tag.dat d g r

Save with "d g" and restore with "d g r"

More information is available here: https://technet.microsoft.com/en-us/library/ee624057.aspx

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top