Jump to content
Sign in to follow this  

Help troubleshooting printer management

Recommended Posts


Ok, I'm hoping someone here can spot a problem that I'm missing.

I'm in the process of converting all my workstations from printing through a print server to using TCP/IP ports. To make things easier, I'm scripting what I can.

The script below is an example of what I'm doing, for an HP LaserJet P3005 and a Color LaserJet 3600.

It works beautifully for both on x64, and for the color on x86, but with the p3005 on x86, I get an "Operation could not be completed" error. Since the only differences between the commands seem to be the driver, it would be the likely culprit. But on the same x86 XP box that throws the error, I can manually install that same driver with no problem. I'm attaching the .inf file in case it helps.

Also, that box already had a P3005 PCL6 driver, so the /u switch on PrintUIEntry should have ignored the driver path, right?

Anybody see something I'm missing?


InstallPrinter("HS Lobby 1","","p3005")
InstallPrinter("HS Lab Color","","clj3600")

Func InstallPrinter($PrName,$Address,$Driver,$Prompt=0)

Local $msg
If $Prompt = 1 Then $msg = MsgBox(35,"Question","Install "&$PrName&"?")
If $msg = 2 Then Exit
If $msg = 7 Then Return

$objWMIService = ObjGet("winmgmts:\\" & @ComputerName & "\root\cimv2")
$objNewPort = $objWMIService.Get("Win32_TCPIPPrinterPort").SpawnInstance_

$objNewPort.Name = "IP_"&$Address
$objNewPort.Protocol = 1
$objNewPort.HostAddress = $Address
$objNewPort.PortNumber = "9100"
$objNewPort.SNMPEnabled = False

$DriverPath = "\\server\util\drivers\"&@OSArch&"\printers"

;I've removed several of the Cases here for brevity.

Case @OSArch="x86" AND $Driver="p3005"
$LocalPath = $DriverPath & "\ljp3005.pcl6\hpc300xc.inf"
$Model = "HP LaserJet P3005 PCL 6"
Case @OSArch="x64" AND $Driver="p3005"
$LocalPath = $DriverPath & "\ljp3005.pcl6\hpc300xu.inf"
$Model = "HP LaserJet P3005 PCL 6"
Case @OSArch="x86" AND $Driver="clj3600"
$LocalPath = $DriverPath & "\clj3600\hpc3600e.inf"
$Model = "HP Color LaserJet 3600"
Case @OSArch="x64" AND $Driver="clj3600"
$LocalPath = $DriverPath & "\clj3600\hpc3600w.inf"
$Model = "HP Color LaserJet 3600"
Case $Driver="wc5135"
$LocalPath = $DriverPath & "\wc5135.ps\x2WPENP.inf"
$Model = "Xerox WorkCentre 5135 PS"
Case $Driver="d2150"
$LocalPath = $DriverPath & "\d2150.pcl6\dlxrozi.inf"
$Model = "Dell 2150cdn Color Printer PCL6"

RunWait('rundll32 printui.dll,PrintUIEntry /if /b "'&$PrName&'" /f "'&$LocalPath&'" /r "IP_'&$Address&'" /m "'&$Model&'" /u')



Share this post

Link to post
Share on other sites

Have you looked at WebJetAdmin?

No, but we're not an hp-only shop. We've also got to manage Xerox machines, Dell printers, and even a few Brothers.

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  

  • Similar Content

    • TheSaint
      By TheSaint
      I have now added a 4th program to the mix, and decided to place all under the banner of a suite - KindEbook Suite.
      I believe it will be better served by having its own topic, rather than attempt to edit the first few posts in the old one - KindEbook Wishlist.
      It is also a chance to de-clutter and make some improvements.
      KindEbook Wishlist
      Add Book & All Formats To Calibre
      Bucket-for-URLs (new)
      Batch Create & Run
      calibre - Integral to the last two of my complimentary programs, and an important element of the first one. Basically an ebook database & conversion program, but also offers plenty more, especially adding ebooks to or removing ebooks from your reading device. Wikipedia
      Sigil - A wonderful open source ebook editor & creator. Great for fixing issues with EPUB files, especially after converting from another format. Wikipedia
      MobileRead Forums - Excellent resource for all things ebook.
      BookBub  - Great advisory source for ebooks, that lets you know via email about great bargains at Amazon Kindle, Kobo, Google Play, Barnes & Noble, Apple iBooks. I still use KindEbook Wishlist with anything I obtain at Amazon via BookBub links, but usually just for a purchase record ... essentially I ADD (mostly freebies) and then immediately RELOCATE to my bought (b) user. A BIG Thanks to @willichan who told me many months ago, about BookBub.
      Usage Of My Programs
      To help others to understand about these programs and how to use them for the best benefit, I thought it best to outline how I use them, usually each and every day.
      KindEbook Wishlist
      Add Book & All Formats To Calibre
    • jguinch
      By jguinch
      Here is an UDF for managing printers.
      Features are :
       - add, remove or rename a printer
       - add or remove a driver
       - add or remove a TCP/IP printer port
       - add or remove a LPR printer port
       - connect to a remote printer
       - enum printers and there configuration and properties
       - pause resume or cancel all jobs of a printer
       - checks if a printer exists
       - print a test page
       - set the default printer
    • faldo
      By faldo
      "The why"
      I've been working over 15 years in the IT industry and have realised that the best way of streamlining operations and support is by combining the concept of selling services (instead of hours) along with a tool built for managing those services.
      For the past 10 years i've been working with some of the leading providers of MSP-tools. The prize set on these comercial tools is quite high and there are usually few licence models to choose from. A smaller it-company will find the cost hard to motivate and in turn have dificulties converting its busines model in order to make more money, classic catch 22
      "The how"
      During the years, i've gathered the pros and cons of these tools, dissected their core and realised there is no magic or rocket science going on. There is however a whole lot of scripting used and that's why i feel AutoIT would be a great foundation for a new project.
      So, i've decided to compile my years of experiance and create a tool for remote management and monitoring of machines over WAN. Instead of monetizing it and try to compete with the big companies i felt it more efficiant to make it open source and hope for community interest and development.
      "The what"
      The following features are under development, some arn't started, some are finished. Check the changelog for more info.
      Base components
      - Agent running as service
      - Central server with MySQL (hub engine)
      - Management client (AutoitGUI/WebGUI)
      Main features
      - Remote execution of shell commands as system or specific user
      - File transfer from/to agent
      - Live monitoring of system resources
      Consequential features (based on main features)
      - Hardware/software inventory
      - Software deployment/updating
      - Patch management
      - Antivirus management
      - OS deployment
      - Disaster recovery
      - Hardware/software/network monitoring
      - Wake on LAN
      - Reporting
      - Remote registry, event viewer, task manager
      - Scripting (obviously)
      Additional features (stand-alone modules)
      - Remote control
      - Servicedesk (based on ITIL)
      - AD-integration
      - Secure communication with SSL and rotating key for every session.
      - SHA256 encryption.
      Remmanaut network overview

      My knowledge of AutoIT is average but i'm novice when it comes to programing structure for collaboration, so if you're willing to help me out in making the project easy to share, i'd be very thankfull. Unfortunatly i'm no php-guru so i'll be concentrating on the AutoitGUI until the agent and hub engine reaches an adequate version.

      If you feel that this tool could benefit you in any way or just want to join the project for the fun of development, don't hesitate to post constructive feedback or hit me a PM.
      Code optimisation to do:
    • faldo
      By faldo
      Remmanaut, the autoit RMM tool.

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.