Kinch
03-15-2005, 10:31 AM
Hi All
I'm a SQL developer but have been asked to put together a page for our intranet to allow people to connect to a given printer. At ths point i need a reality check...
1. I have a html page with an image map and area names ("hot spots") for each of the printers on a given floor e.g.
AREA SHAPE="RECT" COORDS="152,346,210,403" HREF="vbsMapPrinter.vbs">
2. I have a vbscript file stored in a folder which can map a printer
Option Explicit
'** Define Variables and Objects **
Dim netPrinter, UNCpath
'** Set Variables and Objects
UNCpath = "\\Server\PrinterName"
Set netPrinter = CreateObject("WScript.Network")
'** Actually do the mapping
netPrinter.AddWindowsPrinterConnection UNCpath
etc
Ideally I would like to parameterise the vbscript to take a string such as "Servername\Printername" (or indeed \\Printer) so that I don't have to have multiple vbscripts (1 per printer) but instead have a single generalised routine which somehow takes the printer UNC from the "hotspot" on the webpage map
As it stands I still get the File Download Open dialog and the Run dialogs so I imagine this complicates grabbing any parameter
Is what I want to do possible? If so how do I do it?
Thanks a lot for any help you can give
Kinch
I'm a SQL developer but have been asked to put together a page for our intranet to allow people to connect to a given printer. At ths point i need a reality check...
1. I have a html page with an image map and area names ("hot spots") for each of the printers on a given floor e.g.
AREA SHAPE="RECT" COORDS="152,346,210,403" HREF="vbsMapPrinter.vbs">
2. I have a vbscript file stored in a folder which can map a printer
Option Explicit
'** Define Variables and Objects **
Dim netPrinter, UNCpath
'** Set Variables and Objects
UNCpath = "\\Server\PrinterName"
Set netPrinter = CreateObject("WScript.Network")
'** Actually do the mapping
netPrinter.AddWindowsPrinterConnection UNCpath
etc
Ideally I would like to parameterise the vbscript to take a string such as "Servername\Printername" (or indeed \\Printer) so that I don't have to have multiple vbscripts (1 per printer) but instead have a single generalised routine which somehow takes the printer UNC from the "hotspot" on the webpage map
As it stands I still get the File Download Open dialog and the Run dialogs so I imagine this complicates grabbing any parameter
Is what I want to do possible? If so how do I do it?
Thanks a lot for any help you can give
Kinch