install printer batch

Forum Windows XP : Windows XP General Discussion - install printer batch

Tom's Hardware: Over 1.4 million members in 6 different countries available to answer all your high-tech questions. Sign up now! Its free!
Word :    Username :           
 

Archived from groups: microsoft.public.windowsxp.print_fax (More info?)

 

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

Sponsored Links
Register or log in to remove.
Tom's Hardware > Forum > Windows XP > Windows XP General Discussion > install printer batch
Go to:

There are 1157 identified and unidentified users. To see the list of identified users, Click here.

Please mind

You are about to answer a thread that has been inactive for more than 6 months.
If you still wish to proceed, please ensure that your posting is original and does not duplicate or overlap any prior responses to this thread.

Add a reply Cancel
Sponsored links
  • Ask the community now
  • Publish
Ad
They won a badge
Join us in greeting them