Wednesday, November 30, 2011

Installing shared printer remotely using VB Script

Installing shared printer remotely using VB Script

The below HTML code snippet can be used to install the shared printer remotely .

<html>
<title> Add Printer </title>
<head>
<script language="vbscript">
function AddPrinter()
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection "<<Printer Path>>"
WshNetwork.SetDefaultPrinter "<<Printer Path>>"
Document.Write "Printer Installed Successfully , Please Close the Web Page"
end function
</script>
</head>
<body Onload="AddPrinter()">
Installing Selected Printer
</body>
</html>

No comments:

Post a Comment