Solved

script to remove and add network printers when users login

Posted on 2011-02-28
6
264 Views
Last Modified: 2012-05-11
is there a script to to remove some network printers, add a new network printer and set this printer as the default when a user log in?
0
Comment
Question by:grnow
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 3

Expert Comment

by:mnation1
ID: 35004264
What OS are the workstations running?
0
 

Author Comment

by:grnow
ID: 35004283
xp pro
0
 
LVL 4

Assisted Solution

by:ong-hh
ong-hh earned 100 total points
ID: 35004320
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Accepted Solution

by:
mnation1 earned 250 total points
ID: 35004324


Something like this should work.  ( compiled from http://www.petri.co.il/forums/showthread.php?t=6352, and http://www.petri.co.il/forums/showthread.php?t=6486)

Set WshNetwork = CreateObject("WScript.Network")
Set objShell = CreateObject("Wscript.Shell")

WshNetwork.RemovePrinterConnection "\\PrintServer\OldPrinterName"

WshNetwork.AddWindowsPrinterConnection "\\PrintServer\NewPrinterName"

WshNetwork.SetDefaultPrinter "\\PrintServer\NewPrinterName"

Open in new window

0
 
LVL 38

Assisted Solution

by:hdhondt
hdhondt earned 150 total points
ID: 35005057
You can use RUNDLL32 to add and delete printers, as well as many other things. See:

http://www.robvanderwoude.com/2kprintcontrol.php
0
 

Author Comment

by:grnow
ID: 35144182
sorry no appropriate time to try it out the above suggestions 1st...
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Introduction During my participation as a VBScript contributor at Experts Exchange, one of the most common questions I come across is this: "I have a script that runs against only one computer. How can I make it run against a list of computers in …
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

734 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