Solved

Add Printer at log on

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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…
In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
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…
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.

680 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