+ Post New Thread
Results 1 to 6 of 6
How do you do....it? Thread, Install printers onto laptops using a batch file or something....?! in Technical; Come on then you clever lot. I'm about to have our printers upgraded and we're gaining a few more. I'm ...
  1. #1

    Little-Miss's Avatar
    Join Date
    Oct 2007
    Location
    London
    Posts
    5,534
    Thank Post
    2,405
    Thanked 779 Times in 473 Posts
    Blog Entries
    2
    Rep Power
    548

    Install printers onto laptops using a batch file or something....?!

    Come on then you clever lot.

    I'm about to have our printers upgraded and we're gaining a few more.

    I'm trialling PaperCut and through that i've come to the realisation that i haven't installed the printers the way they needed to be for PC-NG to be able to monitor the laptop printing. Cue me thinking how the hell am i going to sort this out. But...

    New printers + my OCD means IP's will possibly be changing thus rendering network printers currently installed on laptops useless (but then drivers may be an issue too i guess).

    SO..

    Is there a way i can create some sort of file that when clicked, will remove the old printers and install the news ones?

    I imagine a few of you are going "duh, yeah" but it's not quite my forte! I currently use VB scripts to install printers onto our network machines (keeping it old skool) so have had a play with that to see if i could tweak it for what i need but haven't had much luck.


    TL: DR i want something i can tell the staff to double click that removes any existing networked printers and adds new ones....

  2. #2
    CamelMan's Avatar
    Join Date
    Feb 2012
    Posts
    251
    Thank Post
    29
    Thanked 76 Times in 52 Posts
    Rep Power
    21
    I've done this before - not really in Win 7:

    This may be useful
    Command Line Printer Control

    Will try and dig out some of my old scripts now...

    EDIT: Found this old script to remove all local printers - its a vbs:
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

    Set colInstalledPrinters = objWMIService.ExecQuery _
    ("Select * from Win32_Printer Where Network = FALSE")

    For Each objPrinter in colInstalledPrinters
    objPrinter.Delete_
    Next
    Last edited by CamelMan; 5th November 2013 at 11:51 AM.

  3. #3
    CamelMan's Avatar
    Join Date
    Feb 2012
    Posts
    251
    Thank Post
    29
    Thanked 76 Times in 52 Posts
    Rep Power
    21
    A better script to remove network as well:
    Delete multiple printers - Script Center - Spiceworks

    Could then install printers via VBS (which I've done but cant remember) or use a batch file with:

    start /wait rundll32 printui,PrintUIEntry /q /in /n\\<<servername>>\<<printername>>l
    start /wait rundll32 printui,PrintUIEntry /q /y /n\\<<servername>>\<<printername>>l
    Last edited by CamelMan; 5th November 2013 at 11:58 AM.

  4. #4

    Join Date
    Dec 2009
    Posts
    270
    Thank Post
    6
    Thanked 33 Times in 31 Posts
    Rep Power
    16
    You could deploy printers by group policy. Then you could auto install printers based on the subnet that the laptop is on.

    Potentially very useful to users if they roam around quite a bit

  5. #5

    Join Date
    Sep 2010
    Posts
    644
    Thank Post
    28
    Thanked 76 Times in 71 Posts
    Rep Power
    22
    Printui is what i have used in the past to delete or add printers where GPO's arent used.
    sample of some script i used to manage printers

    rundll32 printui.dll PrintUIEntry /dl /n "printername" DELETE PRINTER
    rundll32 printui.dll PrintUIEntry /dd /m "printername FROM OEMSETUP.inf" DELETE DRIVER
    rundll32 printui.dll PrintUIEntry /if /F "Driverlocation" /b "printername" /r "PORT" /m "Printer Model name" ADD PRINTER

    adding the /c\\"PC-NAME" to the end of the lines connects to network machines

  6. #6
    BatchFile's Avatar
    Join Date
    Aug 2007
    Location
    Cumbria
    Posts
    963
    Thank Post
    550
    Thanked 128 Times in 106 Posts
    Rep Power
    60
    Quote Originally Posted by SHimmer45 View Post
    Printui is what i have used in the past to delete or add printers where GPO's arent used.
    sample of some script i used to manage printers

    rundll32 printui.dll PrintUIEntry /dl /n "printername" DELETE PRINTER
    rundll32 printui.dll PrintUIEntry /dd /m "printername FROM OEMSETUP.inf" DELETE DRIVER
    rundll32 printui.dll PrintUIEntry /if /F "Driverlocation" /b "printername" /r "PORT" /m "Printer Model name" ADD PRINTER

    adding the /c\\"PC-NAME" to the end of the lines connects to network machines
    +1 for this - it's what I've done in the past (just note that the printui.dll PrintUIEntry is case sensitive(!)) and that, I think, you have to be a local admin to install print drivers in Win 7



SHARE:
+ Post New Thread

Similar Threads

  1. How do I launch using a batch file?
    By Disease in forum Coding
    Replies: 3
    Last Post: 21st August 2012, 09:24 AM
  2. Default Printer Batch File
    By karldenton in forum Windows
    Replies: 13
    Last Post: 23rd March 2010, 06:16 PM
  3. Replies: 12
    Last Post: 12th October 2008, 12:37 AM
  4. Prommisor - Installing using a batch file/macro?
    By googlemad in forum Windows
    Replies: 21
    Last Post: 3rd December 2007, 09:17 PM
  5. Blocking Batch Files using Group Policy in Server 2003
    By markwilliamson2001 in forum Windows
    Replies: 13
    Last Post: 4th October 2005, 06:28 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •