vb.net “RUNDLL32 PRINTUI.DLL,PrintUIEntry /Sr /n... 操作无法完成(错误 0x0000000c)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17364824/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 14:04:26  来源:igfitidea点击:

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

vb.netbatch-filecommandrundll32

提问by user2531854

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

我使用以下命令将打印机设置存储在 .dat 文件中:

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).

然后,我尝试使用此命令(传入我的 ini 值)恢复 VB.net 中的打印机设置。

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).

我收到以下错误:操作无法完成(错误 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?

它适用于我的开发人员机器,但是当我在客户端计算机上安装该应用程序时,它出现了该错误。有任何想法吗?

采纳答案by user2531854

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

我想到了。我需要使用客户端计算机上的现有驱动程序。所以该命令将使用“ u ”标志。

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

回答by Thomas Szteliga

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"

用“d g”保存并用“dg r”恢复

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

更多信息请访问:https: //technet.microsoft.com/en-us/library/ee624057.aspx