I'm working on a script that needs to set up a Xerox Phaser printer using the postscript driver. The computers currently have the PCL driver on them (though the printers aren't set up on them yet.) I want to install the PS driver using the specified INF, and then install the printer using the driver provided after the INF is installed (so as not to accidentally use the PCL driver.) How can I accomplish this in VBScript?
views:
1375answers:
3How can I install a printer driver from an inf, then set up a printer using said driver in vbscript
Here's an example on how to do that: VBScript Install Printer
Edit: For a local printer, make the following changes to the script
oPort.PortName = "LPT1:"
oPort.PortType = 3
And remove the oPort.HostAddress
line
You may want to take a look at using the rundll32 InstallHinfSection Function. That is how I do it. It doesn't require you install any extra ActiveX component. There is a example for how to use it here: http://www.msfn.org/board/Silent-parameters-for-RunDll32-setupapi-t106711.html Basically its, %systemroot%\system32\rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 C:\drivers\2100\PCL 5e\hp211ip5.inf
You may also want to take a look at the PrintUIEntry function, as this will allow you to add the printer if the drivers are already loaded on a system. See here fore further info: http://support.microsoft.com/kb/189105
I always revert to the following links to install printers 'programatically'.