install printer batch

From: Woody (sugargenius_at_houston.rr.com)
Date: 06/28/04


Date: Mon, 28 Jun 2004 19:27:18 GMT

I have a Brother HL-1440 shared on a RH 7.3 box running Samba 2.2.7. I
would like to install the printer on my Windows machines (all XP) with a
script. I tried this:

rundll32 printui.dll,PrintUIEntry /ia /h "Intel" /f %systemdrive%\Drivers
\hl1440\OEMHL01A.INF /m "Brother HL-1440 series" /n\\Homebase\Brother_HL-
1440

When I run the command, a little dialog pops up for a second that says
"Copying files..."

Afterwards, I look in Control Panel -> Printers and Faxes, and it isn't
there.

Next I tried a WMI script like this:

strComputer = "."
Set objWMIService = GetObject("winmgmts:" & _
    "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objDriver = objWMIService.Get("Win32_PrinterDriver")
objDriver.Name = "Brother HL-1440 series"
objDriver.SupportedPlatform = "Windows NT x86"
objDriver.Version = "3"
objDriver.FilePath = "C:\Drivers\hl1440"
objDriver.InfName = "C:\Drivers\hl1440\OEMHL01A.INF"
intResult = objDriver.AddPrinterDriver(objDriver)
WScript.Echo intResult

That returned 0, so I assumed it was 'successful'. Then I ran this:

Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection "\\Homebase\Brother_HL-1440"
WshNetwork.SetDefaultPrinter "\\Homebase\Brother_HL-1440"

I get an error:
"The print driver is unknown."

If I double-click on the printer share through Neighborhood Network, I get
error:
"The server for the printer does not have the correct print driver
installed."

Afterwards, I click on Have Disk and browse to the driver at "C:\Drivers
\hl1440\OEMHL01A.INF" and the printer installs fine.

Is there anyway I can automate this with a script?

Thanks,
Woody



Relevant Pages

  • Re: OT: my new PC rocks!!
    ... my little brother now had to pack it all back ... > Why not first install Windows to prove that the hardware is ok? ... Windows installed okay...though there were "issues" with having ... machine - when the jumper settings weren't right and it must have been ...
    (alt.lang.asm)
  • Re: Brother MFC-215C Printer
    ... Back to your MFC. ... Brother also has a cleanup utility that may need to be used ... to cleanup things between driver installs, or if an install went awry. ...
    (microsoft.public.windowsxp.print_fax)
  • A package is refusing to be removed
    ... I'm trying to get a Brother 8045D scanner/copier/printer work with my Ubuntu 6.06 GNU/Linux. ... If I understood correctly, there are two packages to install, but one has to install them in the right order. ... the problem is that I first installed the CUPS wrapper driver and then the LPR driver. ... When I understood that I've made a mistake, I wanted to remove the LPR driver's package, but it's still there. ...
    (comp.os.linux.misc)
  • Re: Cannot install Brother HL1440 generic driver
    ... except that I could not uninstall two remaining USB ... driver (which is not on the disk, and which is not the current recommended ... > Brother folders. ... >> I cannot install the new, MS signed, downloaded driver. ...
    (microsoft.public.windowsxp.hardware)
  • undetected harddrive in win xp
    ... my brother tried downloading an upgrade for his Norton Security ... install something thats missing which linked him to the Microsoft ... Boot from ATAPI CDROM: Boot from ATAPI CDROM: Disk Boot Failure, ... My brother haven't backup any of his inportant files in over a month, ...
    (alt.comp.hardware.pc-homebuilt)