Addprinterdriver Error 87
Contents |
(עברית)المملكة العربية السعودية (العربية)ไทย (ไทย)대한민국 (한국어)中华人民共和国 (中文)台灣 (中文)日本 (日本語) HomeWindows Server 2012Windows Server 2008 R2Windows Server add printer driver error 87 2003LibraryForums Ask a question Quick access Forums
Error 87 Adding Printer Driver
home Browse forums users FAQ Search related threads Remove From My objdriver addprinterdriver objdriver 87 Forums Asked by: AddPrinterDriver return error 87 Windows Server > Windows PowerShell Question 0 Sign in to vote win32_printerdriver error 87 I'm tring to add printer driver, but AddPrinterDriver method return error 87 Could You tell me, what's wrong? My code: function iBum { Clear-Host $server = read-host "Computer:" $dest =”\\$server\c$\Temp\drivers\W32X86\3” New-Item $dest -type directory -force $DestFolder=”\\$server\c$\Temp\drivers\W32X86\3”
Win32_printerdriver Addprinterdriver
$SrcFolder=”.\drivers\W32X86\3\*” Copy-Item $SrcFolder $DestFolder -force $printerdriverclass =([WMICLASS]"\\$server\ROOT\cimv2:Win32_PrinterDriver") $printerdriverclass.psbase.Scope.Options.EnablePrivileges = $true $printerdriverclass.psbase.Scope.Options.Impersonation = [System.Management.ImpersonationLevel]::Impersonate $printerdriver = $printerdriverclass.createinstance() $printerdriver.Name = "Hp 2055 PCL6" $printerdriver.DriverPath = "C:\Temp\drivers\W32X86\3\iakexl.dll" $printerdriver.ConfigFile = "C:\Temp\drivers\W32X86\3\iakeuixl.dll" $printerdriver.DataFile = "C:\Temp\drivers\W32X86\3\iakexl.dll" $printerdriver.HelpFile = "C:\Temp\drivers\W32X86\3\iakehlxl.chm" $printerdriver.DependentFiles = "C:\Temp\drivers\W32X86\3\iakercxl.dll", ` "C:\Temp\drivers\W32X86\3\iakexl.ini", ` "C:\Temp\drivers\W32X86\3\iakercxl.lrc", ` "C:\Temp\drivers\W32X86\3\mkmuauth.dll", ` "C:\Temp\drivers\W32X86\3\mkmuauth.lrc", ` "C:\Temp\drivers\W32X86\3\mkmxpars.dll", ` "C:\Temp\drivers\W32X86\3\mkmcodec.dll" $rtnCode = $printerdriverclass.AddPrinterDriver($printerdriver) $rtncode.returnValue } Thursday, January 20, 2011 12:33 PM Reply | Quote All replies 0 Sign in to vote no clue, I tested sections of it (objects are all correct) and everything seems ok... what I'd do is run it from the console in admin mode and install to the local machine just t
"{impersonationLevel=impersonate}!\\" & strComputer &"\root\cimv2")objWMIService.Security_.Privileges.AddAsString "SeLoadDriverPrivilege",TrueSet objDriver = objWMIService.Get("Win32_PrinterDriver")objDriver.Name = "HP Color LaserJet 4600 PCL 6"objDriver.SupportedPlatform = "Windows NT returnvalue 87 x86"objDriver.Version = "3"objDriverPath = "\\tmco\replication\TMCO\IT\PRINTERS\clj4600\"objInfname = "\\tmco\replication\TMCO\IT\PRINTERS\clj4600\hp4600p6.inf"intResult = objDriver.AddPrinterDriver(objDriver)wScript.Echo unable to add printer error code 87 intResultI get a pop up of 87. Anyone know what's wrong? I get
Win32_printerdriver
the same errorif I have the driver path and inf file on the c: drive and make thenecessary changes. Thanks. t***@gmail.com 2005-08-03 https://social.technet.microsoft.com/Forums/windowsserver/en-US/ebb21fb6-0643-46b2-b94a-67d7470abd2a/addprinterdriver-return-error-87?forum=winserverpowershell 21:55:41 UTC PermalinkRaw Message os is windows xp sp2. sorry i forgot that. t***@gmail.com 2005-08-08 21:45:28 UTC PermalinkRaw Message ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ t***@gmail.com 2005-08-09 19:10:26 UTC PermalinkRaw Message Ok, here's the deal. Apparently the Script from the M$ script centeris so FUBAR it's not even believable. http://microsoft.public.windows.server.scripting.narkive.com/zl9D16rV/error-87-on-wmi-add-printer-driver-script I found another post wheresomeon was converting a correctly functioning script to C and found theerrors. here's the working scriptstrComputer = "."Set objWMIService = GetObject("winmgmts:" _& "{impersonationLevel=impersonate}!\\" & strComputer &"\root\cimv2")objWMIService.Security_.Privileges.AddAsString "SeLoadDriverPrivilege",Trueset objDriver = objWMIService.Get("Win32_PrinterDriver")objDriver.Name = "HP Color LaserJet 4600 PCL 6"objDriver.SupportedPlatform = "Windows NT x86"objDriver.Version = "3"objDriver.FilePath = "z:\\TMCO\\IT\\PRINTERS\\clj4600\\"objDriver.Infname = "z:\\TMCO\\IT\\PRINTERS\\clj4600\\hp4600p6.inf"intResult = objDriver.AddPrinterDriver(objDriver)wScript.Echo intResultHere are the fixes:you had to have objDriver.FilePath instead of objDriverPathyou had to have objDriver.InfName instead of objInfnameyou had to have double \\ instead of single \ in the directory listingsfor the path and inf file. hope this helps other people. 3 Replies 74 Views Switch to linear view Disable enhanced parsing Permalink to this page Thread Navigation t***@gmail.com 2005-08-03 21:51:44 UTC t***@gmail.com 2005-08-03 21:55:41 UTC t***@gmail.com 2005-08-08 21:45:28 UTC t***@gmail.com 2005-08-09 19:10:26 UTC about - legalese Loading...
Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to https://www.experts-exchange.com/questions/27512197/Unable-to-add-printer-driver-Win32-error-code-87.html Get Help Ask a Question Ask for Help Receive https://ittechlog.wordpress.com/2012/12/28/add-printer-driver-to-windows-7-8-2008-r2-using-a-command-line/ Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines error 87 Experts Exchange > Questions > Unable to add printer driver --- Win32 error code 87 Want to Advertise Here? Solved Unable to add printer driver --- Win32 error code 87 Posted on 2011-12-28 MS DOS Windows XP 1 Verified Solution 7 Comments 8,482 Views Last Modified: driver error 87 2013-04-04 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 Select all Open in new window One may wish to referen
to Windows 7 8 2008 R2 using a commandline Posted on December 28, 2012 by IT Tech Log Adding print drivers to Windows 7 or Windows 2008 (R2) using a script isn’t as easy as it was in earlier versions. Sure, we can use 3th party products as RES Automation Manager to install printer drivers but that product has a price. In this blog post I am going to walk through the steps necessary to install the printer drivers using a command line. Let’s get started. Name Every driver has a name. When we have found the Name we can use this to fill in the script value. You can find the Name if you run the following command: rundll32.exe printui.dll,PrintUIEntry /ii /f C:\epson374750eu\E_GF1HKP.INF replace C:\epson374750eu\E_GF1HKP.INF with the name of your INF file. Click The Printer that I want isn’t listed Click Next Click Next Write down the name and the INF file name
Click Cancel Repeat this step for each INF file. The name is EPSON TX235 Series. If you cannot find the information using these steps, you can always install the driver on a dummy system. After installing the driver, there is an entry created under HKLM\System\CurrentControlSet\Control\Print\Environments\*Environment*\Drivers\Version-*\*name* Script I am not going to use the Epson name found above, I use an other driver for the next steps. The script to add a printer driver is: Cscript C:\Windows\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs -a -m "Xerox Global Print Driver PCL" -i "C:\Xerox\x2UNIVL.inf" -a is Add -m is the Name -i is the location of the INF file Repeat this step for every INF file. Possible errors If you receive a Win32 error code 87 first check the the name. Again, If you cannot find the information from the INF file, you can always install the driver on a dummy system. After installing the driver, there is an entry created under HKLM\System\CurrentControlSet\Control\Print\Environments\*Environment*\Drivers\Version-*\*name* Can't get the solution to work? Contact me and let me do the trick. Like this:Like Loading... This entry was posted in Microsoft General. Bookmark the permalink. ← Citrix Provisioning Services blue screen error0x0000001A Unattended installation of a language pack in Windows 7SP1 → 2 Responses to Add printer driver to Windows 7 8 2008 R2 using a commandline George Jenkins says: February 16, 2013 at 10:53 PM While creating new Windows 7 images, I found that if I copy the HP universal driver then install it post sysprep via a follow up batch file and run cscript c:\windows\system32\printing_admin_scripts\en-us\prndrvr.vbs -a -m "H