Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Will printers mapped by a login script overwrite locally added printers?

Posted on 2006-11-14
5
Medium Priority
?
256 Views
Last Modified: 2010-03-18
I want to add 3 or 4 "Main" printers to my batch file so that EVERYONE gets them mapped automatically at logon.  So if I have these 4 printers mapped using a login script, will the script simply add these printers to everyone printer list, or will it also delete any mapping they had to these or other printers previously?
0
Comment
Question by:tenover
[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
  • 2
  • 2
5 Comments
 
LVL 67

Expert Comment

by:sirbounty
ID: 17940414
I believe you will get a "device in use" error.
You can trap for it though - do you need help setting up that part of your script?
0
 

Author Comment

by:tenover
ID: 17940496
I would leve help, thanks.  The only thing I have in my current login script is a single mapping to a "Shared" drive.  Home directories are mapped via the users profile.
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 17940743
In its simplicity...and to correct what I 'tried' to say before - I believe I was referring to replacing the default printer... : $


Dim objNetwork
Dim aryPrn(3)
Dim prn

set objNetwork=CreateObject("Wscript.Network")

aryPrn(0)="\\PrintServer\Printer1"
aryPrn(1)="\\PrintServer\Printer2"
aryPrn(2)="\\PrintServer\Printer3"
aryPrn(3)="\\PrintServer\Printer4"

on error resume next
For each prn in aryPrn
  objNetwork.AddWindowsPrinterConnection prn
  if err.number <> 0 Then
    msgbox "Unable to attach to printer " & prn
  end if
Next

'Optionally  objNetwork.SetDefaultPrinter "\\PrintServer\Printer1")

Set objNetwork = Nothing

wscript.quit
0
 
LVL 43

Accepted Solution

by:
Steve Knight earned 2000 total points
ID: 17941801
You can also simply add the commands to the batch file itself if you want to stick with batch files rather than VBS (or call the VBS from your bacth file or change all to VBS, your call)

if not exist %userprofile%\printer1.txt start \\server\printer1 & echo Installed > %userprofile%\printer1.txt

which installs the printer and drops a flag file in the user's profile so it doesn;t install it again.  User will get a "printer xyz installed OK" pop up the same as typing \\server\printer1 in start | run box
or similar with:
rundll32 printui.dll,PrintUIEntry /ga /n\\server\printer1 /y

VBS looks nicer and is maybe a bit more controllable, if you prefer batch look at these ways

hth

Steve
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 18544446
Thanks for the points, hope it helped

Steve
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Greetings, Experts! First let me state that this website is top notch. I thoroughly enjoy the community that is shared here; those seeking help and those willing to sacrifice their time to help. It is fantastic. I am writing this article at th…
Trying to figure out group policy inheritance and which settings apply where can be a chore.  Here's a very simple summary I've written which might help.  Keep in mind, this is just a high-level conceptual overview where I try to avoid getting bogge…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

636 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