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

x
?
Solved

Need a login script that will delete certain print queues

Posted on 2008-06-20
16
Medium Priority
?
315 Views
Last Modified: 2013-12-15
Hi Experts!  Here is the situation.  I have a client that has 15 users.  10 out of the 15 use different computers and when they do, they need printers mapped.  I figured no big deal when I signed up to support them but after doing the initial audit, they have printers shared on a few desktops, some shared on the server and a couple others that are local.  A huge mess since no one knows where they are printing when they sit at a different desk.  

I installed USB/NIC adapters and moved the printers that were being shared on the desktops to now be shared on the server.  I changed the other printers that were already on the server so that the naming scheme was consistent.  Here is my problem:

Some of the user profiles on several computers have printers listed that used to be shared by a desktop.  Since that setup doesn't exist, they are getting confused when the login script runs and they see two sets of printers.  I need to add to my login script a way to delete certain printer mappings that may already exist.  I can add the queue name but I don't know what the command is.

You are my only hope.....  : )   Thanks for any assistance you can offer up.  By the way, I know almost nothing on vbscript so if you offer something up that uses that, please be detailed.  
0
Comment
Question by:samiam41
[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
  • 8
  • 7
16 Comments
 
LVL 5

Expert Comment

by:virtuatech
ID: 21833536
0
 
LVL 24

Expert Comment

by:Kenneniah
ID: 21833538
Call prnmngr.vbs from your script.
cscript.exe prnmngr.vbs -d Printername

http://technet2.microsoft.com/windowsserver/en/library/1b6a1588-17f3-48a0-80e9-f52fb65ba21d1033.mspx?mfr=true
0
 
LVL 9

Author Comment

by:samiam41
ID: 21945270
Sorry gents.  Vacation and traveling took its toll on my time.  I apologize for not getting back to this sooner.

Virtuatech > Thanks for the post.  I see that the question was abandonded and the answer was forced.  Have you tried the solution given?  I don't want to wipe out all queue's, just certain ones.  Not sure how to modify the script to exclude the queue's I want to keep.  Any idea?

Kenneniah > Thanks for the post.  I reviewed that technet article before but didn't have any idea how to put together the commands.  I don't work with scripting enough to be able to do that.  If you can put something together, I would gladly test it.
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 9

Author Comment

by:samiam41
ID: 22003136
Any new suggestions?
0
 
LVL 24

Expert Comment

by:Kenneniah
ID: 22025176
You don't have to do any scripting. Just use the command line.

cscript.exe prnmngr.vbs -d Printername

Printername is the printer you want to delete, not much to it. So if a printer you wanted deleted was "HP Deskjet" you'd run...

cscript.exe prnmngr.vbs -d "HP Deskjet"
0
 
LVL 9

Author Comment

by:samiam41
ID: 22025206
Oh....  I get it now.  Do the clients need to have that program on their computer to run?  If so, where should I put it.  Thanks for the help.
0
 
LVL 24

Expert Comment

by:Kenneniah
ID: 22025248
Nope, they are included with XP Professional. Sometimes you might need the full path however, so just to make sure I'd probably make it....
cscript.exe %systemroot%\system32\prnmngr.vbs -d Printername
0
 
LVL 9

Author Comment

by:samiam41
ID: 22025275
Outstanding!  That is perfect!  Thanks for the help.
0
 
LVL 24

Accepted Solution

by:
Kenneniah earned 2000 total points
ID: 22025277
Opps, I forgot the -p    :)
cscript.exe %systemroot%\system32\prnmngr.vbs -d -p Printername

Another option if you want to start from scratch at each login is a simple....
cscript.exe %systemroot%\system32\prnmngr.vbs -x
That will delete all printers, so only those you reconnect later in the logon script will exist.
0
 
LVL 9

Author Comment

by:samiam41
ID: 22025320
Even better!!  Man I am glad to have a solution for this.  I will test it out this weekend and post back any problems with it.  Thanks again for all of your help and patience!
0
 
LVL 9

Author Closing Comment

by:samiam41
ID: 31469263
Thanks again!  I'm pretty confident this will work so I am going to accept the solution now and just post back any questions should any come up in the testing this weekend.  Great work!  Take care!

Regards,
Aaron
0
 
LVL 24

Expert Comment

by:Kenneniah
ID: 22025488
No problem :)
The way I would probably do it is to use the wipe clean method, then add the printers I want them to have in the logon script as well. It would look something like ....

cscript.exe %systemroot%\system32\prnmngr.vbs -x
cscript.exe %systemroot%\system32\prnmngr.vbs -ac -p "\\server\printshare1"
cscript.exe %systemroot%\system32\prnmngr.vbs -ac -p "\\server\printshare2"
etc.
etc.
0
 
LVL 9

Author Comment

by:samiam41
ID: 22025511
They have a PDF creator listed as a printer.  How should that be handled?  I thought about just listing the printers to be deleted rather than trying to add that printer back.
0
 
LVL 24

Expert Comment

by:Kenneniah
ID: 22025889
Hmm, yeah it can be a pain to correctly add some PDF printers through a logon script. In the long run it'll depend on how many printers you actually have to delete. If not too many, it won't take that long to make a line in the logon script for each that you want to remove.
0
 
LVL 9

Author Comment

by:samiam41
ID: 22025912
Cool.  That was what I was thinking.  Just mark out the 4 or 5 printers that I want deleted and then add the correct ones in.  I will leave that PDF printer alone.  I have another client with a similar issue but doesn't have any of the PDF printers that this client does.  You can bet that I will be adding your scripting to their login script.  Wahoo!  Thanks again for all of your help.  If I have any follow up questions, I will let you know.  Take care!
0
 
LVL 24

Expert Comment

by:Kenneniah
ID: 22025989
Sure thing, I'll be around so if you have any questions I'll try to get back ASAP :)
0

Featured Post

Industry Leaders: 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

Can I legally transfer my OEM version of Windows to another PC?  (AKA - Can I put a new systemboard in my OEM PC?) Few of us are both IT and legal experts but we all have our own views of Microsoft's licensing rules and how they apply.  There are…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
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

609 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