JBird80
April 10th, 2008, 12:33 PM
I'm not sure if this is the right forum but it’s a start. I've created a web page that shows where network printers are on a graphical map and when I click on a printer the printer will install. It works wonderfully when it was local but when I moved it to the server running IIS I get the error below.
Line: 1
Char: 1
Error: type mismatch error: 'Installprinter'
Code: 0
URL: printers.whatever.com
HTML Button Code
<input language="vbscript" type="button" value="install" onclick="vbscript:Call Installprinter ('\\printserv\printer1')">
VBScript
option explicit
on error resume next
Dim printer_name
Set WshNetwork = CreateObject("WScript.Network")
Sub Installprinter(printer_name)
WshNetwork.AddWindowsPrinterConnection printer_name
If MsgBox("Set "& printer_name & " as default?", 4, "Set default Printer") = 6 Then
WshNetwork.SetDefaultPrinter printer_name
Else
WScript.Quit
End If
End Sub
Any suggestions or leads on where to research next would be greatly appreciated.
Line: 1
Char: 1
Error: type mismatch error: 'Installprinter'
Code: 0
URL: printers.whatever.com
HTML Button Code
<input language="vbscript" type="button" value="install" onclick="vbscript:Call Installprinter ('\\printserv\printer1')">
VBScript
option explicit
on error resume next
Dim printer_name
Set WshNetwork = CreateObject("WScript.Network")
Sub Installprinter(printer_name)
WshNetwork.AddWindowsPrinterConnection printer_name
If MsgBox("Set "& printer_name & " as default?", 4, "Set default Printer") = 6 Then
WshNetwork.SetDefaultPrinter printer_name
Else
WScript.Quit
End If
End Sub
Any suggestions or leads on where to research next would be greatly appreciated.