Solved

Add Printer at log on

Posted on 2006-10-20
6
327 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
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This is an article about my experiences with remote access to my clients (so that I may serve them) and eventually to my home office system via Radmin Remote Control. I have been using remote access for over 10 years and have been improving my metho…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

705 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

16 Experts available now in Live!

Get 1:1 Help Now