Solved

Add Printer at log on

Posted on 2006-10-20
6
332 Views
Last Modified: 2010-03-19
Windows server 2003. We use the following to add printers at log on.  rundll32 printui.dll,PrintUIEntry /in /n \\server\lexmark  Even after the printer has been added it still pops up the box saying its connecting to "lexmark on server". Is there a command that can be added so that it wont run if the printer is already installed.

Thanks
0
Comment
Question by:amdvar
[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 1

Expert Comment

by:Sandeepraj
ID: 17773556
I wish I didn't have to explain why each one isn't good for this situation but here it goes....


http://www.adminscripteditor.com/scriptlibrary/view.asp?id=478 
... is where i got the script from above...and it did the same thing as my original one-liner.

http://www.adminscripteditor.com/scriptlibrary/view.asp?id=490
... ' This script does the following
' - Removes all network Drives between G: and Z:
' - Reads text files from the \\
' - Looping through the records in "DriveMaps.txt" text file the script will map drives based on group membership
' - Looping through the records in "Printers.txt" text file the script will connect network printers
' based on group membership and assign a default printer based on a second group
... this is definitely NOT what I want to do...and it's far more complicated than it needs to be. Regardless, it uses the very same command "Set objNetwork = CreateObject("Wscript.Network")" to map a printer as the script above does.

http://www.adminscripteditor.com/scriptlibrary/view.asp?id=477
'This script installs printers on XP computers based on computer OU membership
'this script will not prevent roaming users from adding their own connection
... this is also not what I want as I need the printer installed for the entire domain, not just individual OUs. This script uses the line of code I tried in my original question... "rundll32 printui.dll,PrintUIEntry /in /n\\servername\printershare /q" which I have already verified does not work.

http://www.adminscripteditor.com/scriptlibrary/view.asp?id=412
' COMMENT: this script locates all the printers based on the Location
'         and connects the user to all the printers based on location
... i don't need this printer installed by location...i need it installed on all computers in the domain. This script also gets the printers from active directory...and this printer is a shared printer on a server, not listed in AD.

http://www.adminscripteditor.com/scriptlibrary/view.asp?id=387
...Besides the fact that this script is huge, it creates folders, favorites, hides folders, makes drives, sets a default printer and calls c:\printers.bat ... and who knows what that does.

Thanking you
Sandeep raj
0
 
LVL 43

Accepted Solution

by:
Steve Knight earned 125 total points
ID: 17774460
Sandeep, are you the same as amdvar and answering your own q here, bit unsure on what is posted above

Easiest way I can think of is

mkdir "%userprofile%\printers"
if exist "%userprofile%\printers\printer1.txt" goto skip printer1
echo Installed > "%userprofile%\printers\printer1.txt"
rundll32 printui.dll .... etc.
:printer1

i.e. drop a flag file into the user's profile once the printer has been connected.

Steve
0
 

Author Comment

by:amdvar
ID: 17774859
No I didn't have anything to do with the above post..I was kind of stumped myself on what was going on above.
0
 
LVL 8

Assisted Solution

by:nitadmin
nitadmin earned 125 total points
ID: 17778778
You could also use the following in login script.

start    \\print_server\print_name

Cheers,
NITADMIN
0

Featured Post

Technology Partners: 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

Suggested Solutions

If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

751 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