Proper use of prndrvr.vbs
Posted on 2004-08-17
I have been trying to use the Windows vbs scripts to install printers through a batch file, I can get the port created and the printer created & working great if the PC already has a driver installed for that printer. But I can't get it to install the driver if the workstation does not already have one, it gives me a "Win32 error 87". I know I am not the best DOS scripter, I don't do it that offten, but am I even close? What I'd like to do is push this out with the driver and force the installation of the driver that I push out with this bat file. Any suggestions?
This is what I got so far.
** THIS IS WORKING **
REM add the TCP/IP port
cscript %windir%\system32\prnport.vbs -a -r IP_xxx.xxx.xxx.xxx -h xxx.xxx.xxx.xxx -o raw -n 9100
** THIS IS NOT WORKING **
REM install the printer driver
cscript %windir%\system32\prndrvr.vbs -a -h "c:\temp\lj2300n" -i "hpc2300c.inf" -m "HP Laserjet 2300 Series PCL 6" -v 3 -e "Windows NT x86"
** THIS IS WORKING - IF THERE IS A DRIVER INSTALLED ON THE PC ALREADY **
REM Add printer to the port you just created
cscript %windir%\system32\prnmngr.vbs -a -p "Chip" -m "HP Laserjet 2300 Series PCL 6" -r IP_xxx.xxx.xxx.xxx
Thanks for your time!!!