Installing printer drivers via scripts

G

Guest

I am trying to install an HP 2015 printer on multiple teacher machines.
These are on Winxp and Win 2000 PC's. I am usiing the
\windows\system32\prndrvr.vbs script but dkeep getting the following error:
"Unable to add printer driver HP Lasetjet 2015 Win32 error code 87".

The prndrvr line reads: prndrvr.vbs -a -m "HP 2015 Printer" -h
"g:\Printer\drivers" -i "g:\printer\drivers\hppcp504.inf"

Any Ideas?
 
A

Ace

For my Windows Server 2003 environment I currently use KiXtart:
http://www.kixtart.org/
to give my users networked printers based on their computer name, and
computer name is based on 'CLWR01001', which means Company Location
Workstation Room 01, machine 001.
We do this because we have 4 locations under one company name, each with
several hundred computers divided over several departments.
Below a sample script to set 2 printers based on computer name for 2
locations;


--Begin KiX script--

;* Add printer by computer name
;* Sample created 11/10/2007
? "*************************************************"
? "* Welcome to <YOURDOMAIN>. *"
? "*************************************************"
?
?

"- Deleting any printers present - "
$printer = DelTree("HKEY_CURRENT_USER\Printers\connections")

"- Setup printer for Office 01 - "

if instr("%computername%","CLWR01")
if AddPrinterConnection("\\yourdomainserver\yoursharedprintername")
= 0
"Done"
$printer = SetDefaultPrinter("\\yourdomainserver\full printer
name")
Endif
else
"No Printer"
endif
?

"- Setup printer for Office 02 - "

if instr("%computername%","CLWR02")
if AddPrinterConnection("\\yourdomainserver\yoursharedprintername")
= 0
"Done"
$printer = SetDefaultPrinter("\\yourdomainserver\full printer
name")
Endif
else
"No Printer"
endif
?

--End KiX script--


The script can be written and saved with Notepad, plain text.
File Extension can be .kix or other.
This script sits in \\yourdomainserver\NETLOGON along with Kix.exe.
From a user's profile, you can run 'kix scriptname' to have the script
run at logon.
'full printer name' means 'HP Laserjet 4M' for example, the name as shown
in Start/Settings/Printers, and not the share name.
Ofcourse your mileage may vary.. as I do not know your setup.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top