Jump to content

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


Recommended Posts

Posted

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....

Posted (edited)

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

Edited by CamelMan
Posted

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

Posted

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

Posted
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:rolleyes:

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



×
×
  • Create New...