Sign in to follow this  
Followers 0
Netcruzn

Local printer drive install with rundll32 and printui cmds

6 posts in this topic

All,

This should be relatively simple and must just be over looking some little something.

The first run command works if the second is remarked out but neither run otherwise

$osv = @OSVersion
$osbit = @OSArch


If $osv = "WIN_7" and $osbit = "X64" Then

ConsoleWrite("running" & @crlf)
Run("T:\RPM\printer_drivers\Other\dymo\Dymo XP-7-8 8.5\DLS8Setup.8.5.0.exe /s")
Run("rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell Laser Printer 1720dn" /f "T:\RPM\printer_drivers\Dell\1720\X64\drivers\print\win_2kxp\DKABJ740.inf" /F "T:\RPM\printer_drivers\Dell\1720\X64\drivers\print\win_2kxp\DKABJ740.inf")
EndIf

I feel this is the issue:

Run("rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell Laser Printer 1720dn" /f "T:RPMprinter_driversDell1720X64driversprintwin_2kxpDKABJ740.inf" /F "T:RPMprinter_driversDell1720X64driversprintwin_2kxpDKABJ740.inf")

I feel the error is in the line I put above however it loads the driver if I run it from a command prompt and also runs the first run command with the silent install. I have several more I need to run or add to the script just like this. If I can correct one the rest will be cake.

If do not remark out the first run command  it seems to blow by the silent install and never run it and returns this error : Run("rundll32 printui.dll,PrintUIEntry /dd /q /m" "Dell Laser Printer 1720dn" /^ ERROR

I have tried runwait and runas I have local admin rights on all pcs including my test box. As I mentioned both of these work individually from a command prompt.

Run("T:RPMprinter_driversOtherdymoDymo XP-7-8 8.5DLS8Setup.8.5.0.exe /s")
  

Run("rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell Laser Printer 1720dn" /f "T:RPMprinter_driversDell1720X64driversprintwin_2kxpDKABJ740.inf" /F "T:RPMprinter_driversDell1720X64driversprintwin_2kxpDKABJ740.inf")
 

I am new to scripting and autoit so any and all help would be greatly apprecaiated.
 

Thanks,

Net
 

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

When you have double quotes in the run command, or any command like this, you need to either escape the quotes by doubling them or surround the whole string with single quotes like this.

Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell Laser Printer 1720dn" /f "T:\RPM\printer_drivers\Dell\1720\X64\drivers\print\win_2kxp\DKABJ740.inf" /F "T:\RPM\printer_drivers\Dell\1720\X64\drivers\print\win_2kxp\DKABJ740.inf"')
Edited by BrewManNH

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Just to narrow down the issue, what happens if you copy the executable to the local machine and then run? This will tell you if the issue is with the exe or the path.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Thanks brewman and jlogan for your reply. Brewman solved my issue. I felt it was a quote issue but was not sure if I had to many or not enough. I tested it and it works like a champ.

Thanks again you guys are awesome.

Net

Share this post


Link to post
Share on other sites

All I found some but very little on loading drivers locally and not actually doing a physical install. What I am posting below works if you have multiple drivers and manufactures in a shared folder on a network drive. All you need to do is change your path and driver name accordingly.

$osv = @OSVersion
$osbit = @OSArch

 
If $osv = "XP" and $osbit = "X86" Then

   ConsoleWrite("running" & @crlf)
   ;Dymo Driver install package
   Runwait("T:\RPM\printer_drivers\Other\dymo\Dymo XP-7-8 8.5\DLS8Setup.8.5.0.exe /s")
    
   ;Dell Printer Drivers
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell Laser Printer 1720dn" /f "T:\RPM\printer_drivers\Dell\1720\XP\drivers\print\win_2kxp\DKABJ740.inf" /F "T:\RPM\printer_drivers\Dell\1720\XP\drivers\print\win_2kxp\DKABJ740.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell 2330dn Laser Printer XL" /f "T:\RPM\printer_drivers\Dell\2330\XP\win_2kxp\DKACHC40.inf" /F "T:\RPM\printer_drivers\Dell\2330\XP\win_2kxp\DKACHC40.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell 2350dn Laser Printer PS3" /f "T:\RPM\printer_drivers\Dell\2350\XP\Win_2kXP\DKACH540.inf" /F "T:\RPM\printer_drivers\Dell\2350\XP\Win_2kXP\DKACH540.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell 3130cn Color Laser PCL6" /f "T:\RPM\printer_drivers\Dell\3130\X86\dlxbmzi.inf" /F "T:\RPM\printer_drivers\Dell\3130\X86\dlxbmzi.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell 3330dn Laser Printer PS3" /f "T:\RPM\printer_drivers\Dell\3330\XP\sysPS\drivers\print\win_2kxp\DKACI540.inf" /F "T:\RPM\printer_drivers\Dell\3330\XP\sysPS\drivers\print\win_2kxp\DKACI540.inf" ')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell Laser Printer 5210n" /f "T:\RPM\printer_drivers\Dell\5210\XP\drivers\print\win_2kxp\DKAATC40.inf" /F "T:\RPM\printer_drivers\Dell\5210\XP\drivers\print\win_2kxp\DKAATC40.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell 5230n Laser Printer PS3" /f "T:\RPM\printer_drivers\Dell\5230\XP\drivers\Print\Win_2kXP\DKACL540.inf" /F "T:\RPM\printer_drivers\Dell\5230\XP\drivers\Print\Win_2kXP\DKACL540.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell Laser Printer 5310n" /f "T:\RPM\printer_drivers\Dell\5310\X86\drivers\print\win_2kxp\DKAATC40.inf" /F "T:\RPM\printer_drivers\Dell\5310\X86\drivers\print\win_2kxp\DKAATC40.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell 5330dn Mono Laser Printer PS" /f "T:\RPM\printer_drivers\Dell\5330\5330dn_Windows_V1.13_Applications\Printer\PS\English\WINXP_2000_VISTA_32\dp5330.inf" /F "T:\RPM\printer_drivers\Dell\5330\5330dn_Windows_V1.13_Applications\Printer\PS\English\WINXP_2000_VISTA_32\dp5330.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell B2360d-dn Laser Printer XL" /f "T:\RPM\printer_drivers\Dell\b2360\X86\Drivers\Print\GDI\DKADTP40.inf" /F "T:\RPM\printer_drivers\Dell\b2360\X86\Drivers\Print\GDI\DKADTP40.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell B5460dn Laser Printer XL" /f "T:\RPM\printer_drivers\Dell\b5460\X86\Drivers\Print\GDI\DKADPP40.inf" /F "T:\RPM\printer_drivers\Dell\b5460\X86\Drivers\Print\GDI\DKADPP40.inf"')
   
   ;Epson TM-T88
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "EPSON TM-T88V ReceiptE4" /f "T:\RPM\printer_drivers\Other\Epson\Driver\EAPTM-T88V86.INF" /F "T:\RPM\printer_drivers\Other\Epson\Driver\EAPTM-T88V86.INF"')
   
   ;TransAct/Ithica 1000/1500
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "SE1500" /f "T:\RPM\printer_drivers\Other\IJetInstall\IJet\TactIJet.INF" /F "T:\RPM\printer_drivers\Other\IJetInstall\IJet\TactIJet.INF"')
   
   ;Turn on/off bidirectional printing
   ;Run('rundll32 printui.dll,PrintUIEntry /Xs /n "SE1500" attributes -EnableBidi')
EndIf
 
If $osv = "WIN_7" and $osbit = "X86" Then

   ConsoleWrite("running" & @crlf)
   ;Dymo Driver install package
   Runwait("T:\RPM\printer_drivers\Other\dymo\Dymo XP-7-8 8.5\DLS8Setup.8.5.0.exe /s")
    
   ;Dell Printer Drivers
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell Laser Printer 1720dn" /f "T:\RPM\printer_drivers\Dell\1720\X86\drivers\print\win_2kxp\DKABJ740.inf" /F "T:\RPM\printer_drivers\Dell\1720\X86\drivers\print\win_2kxp\DKABJ740.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell 2330dn Laser Printer XL" /f "T:\RPM\printer_drivers\Dell\2330\XP\win_2kxp\DKACHC40.inf" /F "T:\RPM\printer_drivers\Dell\2330\XP\win_2kxp\DKACHC40.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell 2350dn Laser Printer PS3" /f "T:\RPM\printer_drivers\Dell\2350\XP\Win_2kXP\DKACH540.inf" /F "T:\RPM\printer_drivers\Dell\2350\XP\Win_2kXP\DKACH540.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell 3130cn Color Laser PCL6" /f "T:\RPM\printer_drivers\Dell\3130\X86\dlxbmzi.inf" /F "T:\RPM\printer_drivers\Dell\3130\X86\dlxbmzi.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell 3330dn Laser Printer PS3" /f "T:\RPM\printer_drivers\Dell\3330\XP\sysPS\drivers\print\win_2kxp\DKACI540.inf" /F "T:\RPM\printer_drivers\Dell\3330\XP\sysPS\drivers\print\win_2kxp\DKACI540.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell Laser Printer 5210n" /f "T:\RPM\printer_drivers\Dell\5210\XP\drivers\print\win_2kxp\DKAATC40.inf" /F "T:\RPM\printer_drivers\Dell\5210\XP\drivers\print\win_2kxp\DKAATC40.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell 5230n Laser Printer PS3" /f "T:\RPM\printer_drivers\Dell\5230\XP\drivers\Print\Win_2kXP\DKACL540.inf" /F "T:\RPM\printer_drivers\Dell\5230\XP\drivers\Print\Win_2kXP\DKACL540.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell Laser Printer 5310n" /f "T:\RPM\printer_drivers\Dell\5310\X86\drivers\print\win_2kxp\DKAATC40.inf" /F "T:\RPM\printer_drivers\Dell\5310\X86\drivers\print\win_2kxp\DKAATC40.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell 5330dn Mono Laser Printer PS" /f "T:\RPM\printer_drivers\Dell\5330\5330dn_Windows_V1.13_Applications\Printer\PS\English\WINXP_2000_VISTA_32\dp5330.inf" /F "T:\RPM\printer_drivers\Dell\5330\5330dn_Windows_V1.13_Applications\Printer\PS\English\WINXP_2000_VISTA_32\dp5330.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell B2360d-dn Laser Printer XL" /f "T:\RPM\printer_drivers\Dell\b2360\X86\Drivers\Print\GDI\DKADTP40.inf" /F "T:\RPM\printer_drivers\Dell\b2360\X86\Drivers\Print\GDI\DKADTP40.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell B5460dn Laser Printer XL" /f "T:\RPM\printer_drivers\Dell\b5460\X86\Drivers\Print\GDI\DKADPP40.inf" /F "T:\RPM\printer_drivers\Dell\b5460\X86\Drivers\Print\GDI\DKADPP40.inf"')
   
   ;Epson TM-T88
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "EPSON TM-T88V ReceiptE4" /f "T:\RPM\printer_drivers\Other\Epson\Driver\EAPTM-T88V86.INF" /F "T:\RPM\printer_drivers\Other\Epson\Driver\EAPTM-T88V86.INF"')
   
   ;TransAct/Ithica 1000/1500
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "SE1500" /f "T:\RPM\printer_drivers\Other\IJetInstall\IJet\TactIJet.INF" /F "T:\RPM\printer_drivers\Other\IJetInstall\IJet\TactIJet.INF"')
   
   ;Turn on/off bidirectional printing
   ;Run('rundll32 printui.dll,PrintUIEntry /Xs /n "SE1500" attributes -EnableBidi')
EndIf

If $osv = "WIN_7" and $osbit = "X64" Then

   ConsoleWrite("running" & @crlf)
   ;Dymo Driver install package
   Runwait("T:\RPM\printer_drivers\Other\dymo\Dymo XP-7-8 8.5\DLS8Setup.8.5.0.exe /s")
   
   ;Dell Printer Drivers
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell Laser Printer 1720dn" /f "T:\RPM\printer_drivers\Dell\1720\X64\drivers\print\win_2kxp\DKABJ740.inf" /F "T:\RPM\printer_drivers\Dell\1720\X64\drivers\print\win_2kxp\DKABJ740.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell 2330dn Laser Printer XL" /f "T:\RPM\printer_drivers\Dell\2330\XP\win_2kxp\DKACHC40.inf" /F "T:\RPM\printer_drivers\Dell\2330\XP\win_2kxp\DKACHC40.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell 2350dn Laser Printer PS3" /f "T:\RPM\printer_drivers\Dell\2350\XP\Win_2kXP\DKACH540.inf" /F "T:\RPM\printer_drivers\Dell\2350\XP\Win_2kXP\DKACH540.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell 3130cn Color Laser PCL6" /f "T:\RPM\printer_drivers\Dell\3130\X64\dlxbmzi.inf" /F "T:\RPM\printer_drivers\Dell\3130\X64\dlxbmzi.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell 3330dn Laser Printer PS3" /f "T:\RPM\printer_drivers\Dell\3330\XP\sysPS\drivers\print\win_2kxp\DKACI540.inf" /F "T:\RPM\printer_drivers\Dell\3330\XP\sysPS\drivers\print\win_2kxp\DKACI540.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell Laser Printer 5210n" /f "T:\RPM\printer_drivers\Dell\5210\X64\DKAATC40.inf" /F "T:\RPM\printer_drivers\Dell\5210\X64\DKAATC40.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell 5230n Laser Printer PS3" /f "T:\RPM\printer_drivers\Dell\5230\XP\drivers\Print\Win_2kXP\DKACL540.inf" /F "T:\RPM\printer_drivers\Dell\5230\XP\drivers\Print\Win_2kXP\DKACL540.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell Laser Printer 5310n" /f "T:\RPM\printer_drivers\Dell\5310\X64\DKAATC40.inf" /F "T:\RPM\printer_drivers\Dell\5310\X64\DKAATC40.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell 5330dn Mono Laser Printer PS" /f "T:\RPM\printer_drivers\Dell\5330\5330dn_Windows_V1.13_Applications\Printer\PS\English\WINXP_VISTA_64\dp5330.inf" /F "T:\RPM\printer_drivers\Dell\5330\5330dn_Windows_V1.13_Applications\Printer\PS\English\WINXP_VISTA_64\dp5330.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell B2360d-dn Laser Printer XL" /f "T:\RPM\printer_drivers\Dell\b2360\X64\Drivers\Print\GDI\DKADTP40.inf" /F "T:\RPM\printer_drivers\Dell\b2360\X64\Drivers\Print\GDI\DKADTP40.inf"')
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "Dell B5460dn Laser Printer XL" /f "T:\RPM\printer_drivers\Dell\b5460\X64\Drivers\Print\GDI\DKADPP40.inf" /F "T:\RPM\printer_drivers\Dell\b5460\X64\Drivers\Print\GDI\DKADPP40.inf"')
   
   ;Epson TM-T88
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "EPSON TM-T88V ReceiptE4" /f "T:\RPM\printer_drivers\Other\Epson\Driver64\EAPTM-T88V64.INF" /F "T:\RPM\printer_drivers\Other\Epson\Driver64\EAPTM-T88V64.INF"')
   
   ;TransAct/Ithica 1000/1500
   Run('rundll32 printui.dll,PrintUIEntry /ia /q /m "SE1500" /f "T:\RPM\printer_drivers\Other\IJetInstall\IJet\TactIJet.INF" /F "T:\RPM\printer_drivers\Other\IJetInstall\IJet\TactIJet.INF"')
   
   ;Turn on/off bidirectional printing
   ;Run('rundll32 printui.dll,PrintUIEntry /Xs /n "SE1500" attributes -EnableBidi')
EndIf

I hope this helps someone as others have been nice enough to help me. This can be changed up simply by altering the printui commands I have used.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0