Solved

How to remove and add LOCAL printers via script

Posted on 2016-09-20
5
53 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 29

Expert Comment

by:Randy Downs
Comment Utility
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 250 total points
Comment Utility
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 24

Assisted Solution

by:lionelmm
lionelmm earned 250 total points
Comment Utility
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
Comment Utility
What is your exact question - this is not clear
0
 

Author Closing Comment

by:tucktech
Comment Utility
Printui scripts are the way to go for this problem.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Scenario:  You do full backups to a internal hard drive in either product (SBS or Server 2008).  All goes well for a very long time.  One day, backups begin to fail with a message that the disk is full.  Your disk contains many, many more backups th…
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup". After a while, you have entered a loop for Auto repair which does not fix anything and you will be in a  panic as all your work w…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
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.

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now