Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Installing Printers With PDQ Using Batch Files

I will post the scripts I use with the Dell Universal and HP Universal print drivers and what I had to do to make them work consistently on Windows 10 Machines.

0

Comments

2 comments
Date Votes
  • I have a few batch files that some of you might already have. I have found these to work on all Windows 7 machines, as well as Windows 10 machines. They do not require a .csv file like the PowerShell script. Hope this finds some helpful. I did not create these myself, but i did modify them to work in my environment.

    A word of advice. In my environment, I noticed that there was issues using my domain admin credentials to install the printers. The work around I found was using the local admin account created on the machines.

    login for local admin: (The Domain username is a period)
    Domain: .
    User: Administrator

    CLS
    @ECHO off

    SET varIP=IP ADDRESS OF PRINTER
    SET varDriver=Dell Printer Driver v2
    SET varDriverFolder=\\SHARE\Software\Printer_Drivers\GDI_dell
    SET varDriverFile=\\SHARE\Software\Printer_Drivers\GDI_dell\DKUD1o40.INF
    SET varName=Printer Name
    SET varLocation=Printer Location

    REM "Deleting TCP/IP port"
    REM CSCRIPT /nologo C:\Windows\System32\Printing_Admin_Scripts\en-US\prnport.vbs -d -r IP_%varIP%

    REM "Creating TCP/IP port"
    CSCRIPT /nologo C:\Windows\System32\Printing_Admin_Scripts\en-US\prnport.vbs -a -r IP_%varIP% -o raw -n 9100 -h %varIP%

    REM "Installation message"
    @ECHO.
    @ECHO The %varLocation% printer is currently being installed.
    @ECHO.
    @ECHO Please do not close this window.
    @ECHO.
    @ECHO Once the installation is complete this Setup window will exit.
    @ECHO.

    REM "Driver installation"
    CSCRIPT /nologo C:\Windows\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs -a -m "%varDriver%" -h "%varDriverFolder%" -i "%varDriverFile%"

    REM "Printer deletion"
    @ECHO.
    @ECHO Completing installation.
    CSCRIPT /nologo C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs -d -p "%varName%"

    REM "Printer installation"
    @ECHO.
    @ECHO Completing installation.
    CSCRIPT /nologo C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs -a -p "%varName%" -m "%varDriver%" -r "IP_%varIP%"

    REM "Location configuration"
    @ECHO.
    @ECHO Completing installation.
    CSCRIPT /nologo C:\Windows\System32\Printing_Admin_Scripts\en-US\prncnfg.vbs -t -p "%varName%" -l "%varLocation%"

    REM "Making it Default printer"
    REM CSCRIPT C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs -p "%varName%" -t
    pause

    Remember: If it fails when you install the first time or succeeds and the printer does not show in the Devices and Printers option, try a different user. I have had luck with both my domain admin and local admin, but it varies.

    0
  • For the HP Universal Deployment I have found this to work effectively with my domain account.

    @echo off

    title [STEP 1:] Starting Printer Installation...
    echo.

    echo [STEP 2:] Installing Printer... Please Wait...
    "\\SHARE\Software\Printer_Drivers\HPUPDPS\install.exe" /q /n"Printer Name Here" /sm10.0.0.0
    The 10.0.0.0 is the field where the IP Address of the Printer will go.

    echo [STEP 3:] Finishing Installation...

    0