install printer batch
From: Woody (sugargenius_at_houston.rr.com)
Date: 06/28/04
- Next message: pfoster: "XP Fax does not work with DSL"
- Previous message: Alan Morris\(MSFT\): "Re: How access print server with ICF activated?"
- Messages sorted by: [ date ] [ thread ]
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
- Next message: pfoster: "XP Fax does not work with DSL"
- Previous message: Alan Morris\(MSFT\): "Re: How access print server with ICF activated?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|