Solved

How to remove and add LOCAL printers via script

Posted on 2016-09-20
5
78 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
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 250 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 24

Assisted Solution

by:lionelmm
lionelmm earned 250 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
A procedure for exporting installed hotfix details of remote computers using powershell
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

920 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

13 Experts available now in Live!

Get 1:1 Help Now