This topic contains 3 replies, has 2 voices, and was last updated by
November 6, 2013 at 3:27 am #11204
I'm trying to change the driver in one of our printers (150 clients)... It not going to well I most admit.
OS = Windows 7 x64
PS version = 2.0
I trying with these commands:
Step 1. Import the new driver:
pnputil -a C:\Users\root\Desktop\HPM400_drivers\*.inf <– that seems to work Output from command: ————————————————— Microsoft PnP Utility Processing inf : hpbuio35l.inf Driver package added successfully. Published name : oem13.inf Processing inf : hpcm401c.inf Driver package added successfully. Published name : oem14.inf Processing inf : hpcm401u.inf Driver package added successfully. Published name : oem15.inf Total attempted: 3 Number successfully imported: 3 ————————————————— So now when the driver is imported I most change the current printer driver of the printer "printer1" to the newly imported. Tried the following commmand: & rundll32 printui.dll PrintUIEntry /Xs /n "printer1" DriverName "drivername" This gives me an error of: "....Windows could cannot locate the suitable driver.." Then I thought I could export the configuration from a allready configured printer with the right driver.. and then Import the settings on another computer... Try 2: Client1 export the configuration: & rundll32 printui.dll PrintUIEntry /Ss /n "printer1" /a "printer1.dat" Client2 Import the configuration: & rundll32 printui.dll PrintUIEntry /Sr /n "printer1" /a "printer1.dat" No luck here either. Export = ok import = fail ...and yes, I imported the new driver before I did the import of the configuration. Any ideas of another solution I should use? Best regard Cristopher Hermansson
November 6, 2013 at 4:36 am #11206MemberTopics: 9Replies: 2322Points: 0Rank: Member
Check out the VBScripts in c:\windows\system32\Printing_Admin_Scripts\en-US\ . Use prndrvr.vbs to install the driver, then prncnfg.vbs to modify the properties of an existing printer (or prnmngr.vbs to create a new one).
You can either call the scripts from your PowerShell script (using cscript.exe), or you can rewrite them in PowerShell if you'd like; they do all the work using WMI.
November 6, 2013 at 5:27 am #11208
Thanks! Will check this out!
November 7, 2013 at 5:04 am #11264
Ended with that I removed the printer and added it againt. Didn't managed to just switch the printer driver.
The topic ‘Change Printer driver with powershell’ is closed to new replies.