Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to remove and add LOCAL printers via script

Posted on 2016-09-20
5
Medium Priority
?
480 Views
Last Modified: 2016-09-23
Hello, I have an environment that I want to remove the printers (including the drivers) and add them back via a script.  These printers work best if they are LOCAL so I need to have them install via the local machine and not on a print server.

These systems are on a AD Domain with the DC having Windows 2008

Windows 7 64bit and 32bit systems.
0
Comment
Question by:tucktech
5 Comments
 
LVL 30

Expert Comment

by:Randy Downs
ID: 41807967
Try this  .

VBS
set objNetwork = CreateObject(“WScript.Network”)
objNetwork.RemovePrinterConnection “\\Your_print_server\printer_name_being_removed”
objNetwork.AddWindowsPrinterConnection “\\Your_print_server\printer_name_being_added”

Open in new window


Logon Script
 @echo off 
    Pushd %~dp0 
    Cscript printerinst.vbs

Open in new window

0
 
LVL 12

Accepted Solution

by:
Sandeep earned 1000 total points
ID: 41808486
You can use PrintUI tool to configure the script (.bat) and remove the network printer and add same printers as Local printers.

https://technet.microsoft.com/en-us/library/ee624057(v=ws.11).aspx

This article is self explaining so you should be able to try it on one system by using command prompt. Once you are sure it works save same commands in a batch file one after the other like printer removal command on first line and on next addition of printer. I assume you have same name of printer to add and remove on all machines. Then use same batch file to run from all machines and hope this should work.
0
 
LVL 26

Assisted Solution

by:Lionel MM
Lionel MM earned 1000 total points
ID: 41808574
This site is similar to the one already provided -- I use it as my reference point so it may help you too http://windowsitpro.com/windows/how-can-i-add-printer-command-line; shows how to add, remove, & delete drivers & printers
0
 

Expert Comment

by:jdmailny
ID: 41811864
What is your exact question - this is not clear
0
 

Author Closing Comment

by:tucktech
ID: 41812285
Printui scripts are the way to go for this problem.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
There are many software programs on offer that will claim to magically speed up your computer. The best advice I can give you is to avoid them like the plague, because they will often cause far more problems than they solve. Try some of these "do it…
This Micro Tutorial will teach you the basics of configuring your computer to improve its speed. It will also teach you how to disable programs that are running in the background simultaneously. This will be demonstrated using Windows 7 operating…
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
Suggested Courses

879 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question