使用 Web 浏览器添加打印机



我正在寻找从Web浏览器添加打印机(Windows(的解决方案。我找到了一些HTA文件解决方案,但是HTA文件运行过时的IE版本,在我的情况下,这是无法使用的。

有人经历过吗?

感谢您的任何解决方案, 此致敬意 米哈尔·普赫默特尔

如果您尝试安装的是网络打印机,则可以使用以下代码,前提是用户知道打印机的名称以及服务器的主机名或 IP 地址。

将以下代码另存为 HTA 文件。

<html>
<head>
<title>Printer Install</title>
<HTA:APPLICATION 
APPLICATIONNAME = "Printer Install"
SCROLL = "Yes"
MAXIMIZEBUTTON = "no"
SINGLEINSTANCE = "yes"
INNERBORDER = "yes"
BORDER = "dialog"
NAVIGABLE = "no"
CONTEXTMENU = "no"
ICON = ""
</head>
<SCRIPT Language="VBScript">
Sub Window_Onload
Self.ResizeTo 450, 400
Self.MoveTo 420, 190
End Sub
Set Objnetwork = CreateObject("wscript.network")
Sub Install
printserver = document.getElementById("server").value
strPrinterName = document.getElementById("name").value
strprinterpath = "\" & printserver & "" & strPrinterName
objNetwork.AddWindowsPrinterConnection strprinterpath
MsgBox "Successfully mapped" & "\" & printserver & "" & strPrinterName
End Sub
</SCRIPT>
<body>
Printer Server: <input type="text" id="server"></input><p>
Printer Name: <input type="text" id="name"></input><p>
<input type="button" onclick="Install" value="Install"></input><p>
</body>
</html>

最新更新