Link to home
Start Free TrialLog in
Avatar of Pkafkas
Pkafkas

asked on

Unable to add printer driver --- Win32 error code 87

Hello:

I have a batch file that works on my PC; but, not on other PC's.  Please see the code attached.  Additionally, similar batch files work just fine on these 'other PC's; but, I think the problem is 'Printer Driver' Specific.

 
@echo off
rem "Printer Automation"
rem "Mapping the network drive"
cd \
net use v: /DELETE
net use v: \\192.168.1.7\eSTUDIO

rem "Creating TCP/IP port"
cd \
cscript %windir%\system32\prnport.vbs -d -r IP_192.168.1.250
cscript %windir%\system32\prnport.vbs -a -r IP_192.168.1.250 -o raw -n 9100 -h 192.168.1.250

rem "Installing Printer's Driver"
cscript %windir%\system32\prndrvr.vbs -a -m "TOSHIBA e-STUDIO6530CSeriesPCL6" -h "V:\\2015\\" -i "V:\\2015\\eS6cx2.inf"

rem "Installing Printer"
cscript %windir%\system32\prnmngr.vbs -a -p "SmallCopyToshibaPCL6" -m "TOSHIBA e-STUDIO6530CSeriesPCL6" -r "IP_192.168.1.250"

rem "Deleting mapped drive"
net use v: /DELETE

Open in new window


One may wish to reference:  https://www.experts-exchange.com/questions/27497717/How-to-create-a-batch-file-to-add-a-pritner-via-IUP-address.html

The batch file bombs out on line 14 .  The error is:

Unable to add printer driver TOSHIBA e-STUDIO6530CSeriesPCL6 Win32 error code 87

What can I do to fix this problem?
Avatar of Pkafkas
Pkafkas

ASKER

The out put, line by line is as follows (on a PC that it doe snot work on.

H:\>net use v: \\192.168.1.7\eSTUDIO
The command completed successfully.


H:\>cscript %windir%\system32\prnport.vbs -a -r IP_192.168.1.250 -o raw -n 9100
-h 192.168.1.250
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.

Created/updated port IP_192.168.1.250

H:\>cscript %windir%\system32\prndrvr.vbs -a -m "TOSHIBA e-STUDIO6530CSeriesPCL6
" -h "V:\\2015\\" -i "V:\\2015\\eS6cx2.inf"
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.

Unable to add printer driver TOSHIBA e-STUDIO6530CSeriesPCL6 Win32 error code 87


H:\>cscript %windir%\system32\prnmngr.vbs -a -p "SmallCopyToshibaPCL6" -m "TOSHI
BA e-STUDIO6530CSeriesPCL6" -r "IP_192.168.1.250"
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.

Unable to add printer SmallCopyToshibaPCL6 Error 0x80041001 Generic failure
Operation PutInstance
Provider Win32 Provider
Description The printer driver is unknown.
Win32 error code 1797

H:\>
Avatar of Pkafkas

ASKER

What does the part of the code, in line 14 supposed to do:  "V:\\2015\\" -i "V:\\2015\\eS6cx2.inf"

There is no 2015 folder there.

ASKER CERTIFIED SOLUTION
Avatar of Don Thomson
Don Thomson
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Pkafkas

ASKER

DTHConsulting: I wil try that and get back to you.
Avatar of Pkafkas

ASKER

The suggestion form DTHConsulting:  worked.  Thank you,
I have the same issues it works on my machine but when running on a different maching it doesn't work.
see output from non working PC below


C:\Users\OFFICE~1\AppData\Local\Temp\IXP000.TMP>cscript c:\windows\system32\prin
ting_admin_scripts\en-us\prndrvr.vbs -a -m "TOSHIBA e-STUDIO4520CSeriesPCL6" -h "\..\eS4ex6.INF"
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

Unable to add printer driver TOSHIBA e-STUDIO4520CSeriesPCL6 Printer Driver Disk
 Win32 error code 87

C:\Users\OFFICE~1\AppData\Local\Temp\IXP000.TMP>cscript c:\windows\system32\prin
ting_admin_scripts\en-us\prnport.vbs -a -r "Toshiba Kitchen" -h 192.xxx.xxx.xxx -o
 raw -n 9100 -me -y "public" -i 1
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

Created/updated port Toshiba Kitchen

C:\Users\OFFICE~1\AppData\Local\Temp\IXP000.TMP>cscript c:\windows\system32\prin
ting_admin_scripts\en-us\prnmngr.vbs -a -p "Kitchen/BreakRoom" -m "TOSHIBA e-STU
DIO4520CSeriesPCL6" -r "Toshiba Kitchen"
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

Unable to add printer Kitchen/BreakRoom Error 0x80041001 Generic failure
Operation PutInstance
Provider Win32 Provider
Description The printer driver is unknown.
Win32 error code 1797

C:\Users\OFFICE~1\AppData\Local\Temp\IXP000.TMP>pause
Press any key to continue . . .