Please Read: Significant Update Planned, Migrating Forum Software This Month

See more
See less

Add Printer Script - with driver location included

  • Filter
  • Time
  • Show
Clear All
new posts

  • Add Printer Script - with driver location included

    Hi All.

    New here but have used the site often to sort problem but this is one I can't seem to find an answer for....maybe its not pssible?

    I have a Server 2003 AD and print server. On the print server I have a couple of printers. I have a scritp that runs that installs the printers during logon. This method I use at a lot of client and works great.

    However for some reason here the Brother HL-5130 driver doesn't install completely and when the script runs to install the printer nothing happens. The other printers install fine.
    If I browse to \\DC and right click printer and connect, then I am told that the driver isn't installed correctly and I have to browse for the file. Once I have browsed I it works and works everytime.

    I don't want to have to do it on every machine so was wondering if its possible to edit my script below so it defines where the driver is. For example the download driver INF is in \\dc\\driver

    'Printers.vbs - Windows Logon Script.
    'add printer connections
    Dim objNetwork, strUNCPrinter
    strUNCPrinter = "\\ntserver\printer1"
    strUNCPrinter1 = "\\ntserver\printer2"
    Set objNetwork = CreateObject("WScript.Network") 
    objNetwork.AddWindowsPrinterConnection strUNCPrinter
    objNetwork.AddWindowsPrinterConnection strUNCPrinter1
    'set the default printer
    objNetwork.SetDefaultPrinter strUNCPrinter
    Last edited by biggles77; 2nd June 2009, 13:55. Reason: Wrap text in CODE

  • #2
    Re: Add Printer Script - with driver location included

    You can write a WMI script "Install a Printer Driver not Found in Drivers Cab". where "objDriver.Name" should be the exact name that you can find in the inf file of the printer driver.

    Or, use the %windir%\system32\Prndrvr.vbs that is already on the computer.


    This posting is provided "AS IS" with no warranties, and confers no rights.


    ** Remember to give credit where credit's due **
    and leave Reputation Points for meaningful posts


    • #3
      Re: Add Printer Script - with driver location included

      write a batch file that contains the following:

      cscript %windir%\system32\prnmngr.vbs -ac -p "\\server\printer

      As already said that leverages the prnmngr.vbs script found in the win32 directory.