Solved

script to remove and add network printers when users login

Posted on 2011-02-28
6
265 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

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!

Question has a verified solution.

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

This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
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…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Suggested Courses

628 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