Solved

How to map a print queue inside command prompt?

Posted on 2002-05-15
9
537 Views
Last Modified: 2008-02-01
Is it possible to map a print queue via the command prompt?
0
Comment
Question by:keywaitao
[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
  • 2
  • +3
9 Comments
 
LVL 1

Expert Comment

by:Old_Dog
ID: 7016146
Others may do different, but I use a VB script to map printers correctly regardless of where a User might log in.

Save the list below into a text document and rename it with a .vbs suffix.  You can then either
a) Run the script manually by double-clicking on it
b) Use it as a logon script.


' VB SCRIPT START

Dim myLan, sUser, sMachine, startTime
Dim myShell
Dim printer1, printer2, printer3

' List the print queues available on the server :

printer1   = "\\server\HP4100UP"     ' A printer upstairs
printer2   = "\\server\HP4100DOWN"   ' A printer downstairs
printer3   = "\\PC15\HP990CUP"       ' Another upstairs

Set myLan = CreateObject("WScript.Network")
Set myShell = CreateObject("WScript.Shell")

'Looping this section to wait for PC name and username :
sUser = myLan.UserName
sMachine = myLan.ComputerName
startTime = Now
Do While sUser = ""
   If DateDiff("s", startTime, Now) > 30 Then Wscript.Quit
   Wscript.Sleep 500
   sUser = myLan.UserName
   sMachine = myLan.ComputerName
Loop

' "PC1" is the machine name of a PC downstairs...
If (sMachine = "PC1") Then
   myLan.RemovePrinterConnection printer1, true, true
   myLan.RemovePrinterConnection printer2, true, true
   myLan.AddWindowsPrinterConnection printer3
   myLan.SetDefaultPrinter printer3
End If

' "PC26" is a machine upstairs...
If (sMachine = "PC26") Then
   myLan.RemovePrinterConnection printer3, true, true
   myLan.AddWindowsPrinterConnection printer1
   myLan.AddWindowsPrinterConnection printer2
   myLan.SetDefaultPrinter printer1
End If

' VB SCRIPT END
...etc etc

0
 

Author Comment

by:keywaitao
ID: 7043556
Is there any method to use other than VB script?
I am not familiar with it. Also, to run VBScript, it must have the help of Windows Script Host.
0
 
LVL 2

Accepted Solution

by:
gavrc earned 100 total points
ID: 7061674
There is a "capture" command in DOS which might help you. For example we use:
"capture lpt2 q=q127_jet nb na nff ti=15"
in a logon script for one of our users. q127 is the print queue in question.
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!

 

Author Comment

by:keywaitao
ID: 7072474
Is this the command "capture" just exists in Win XP?
0
 
LVL 2

Expert Comment

by:gavrc
ID: 7074890
Capture isn't supported by NT4 and is used to grab printer queues on Netware servers. Queues on Windows servers can be captured using the "net use" command as described here...
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q154498
Any help?
(BTW I left out the # at the beginning of the login script line)
0
 
LVL 27

Expert Comment

by:Asta Cu
ID: 7135354
Have you been helped here or is more needed?  Since time has passed since your last comment, an update is appreciated (in case things have changed).  If you've been helped, convert the expert's comment to the Accepted Answer to grade and close it.  If more than one helped you, ask for a point split by posting a zero point question in the Community Support topic area, include this link and details with your request (expert name and point values to each).

This is the Community Support link:
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt

Thanks,
":0)
Asta
0
 
LVL 27

Expert Comment

by:Asta Cu
ID: 7289078
Hopefully you've already been helped, and this question remains open today for your next action.  If you've been helped, please convert that expert's comment to the answer to grade and close this.  If more than one helped you resolve this, request a Point Split via a zero point question in the Community Support topic area with details and this question link (URL).  

This may interest you, if not already done, follows.

Windows XP Service Patch 1 (CRITICAL UPDATE) was available using WindowsUpdate recently (huge), more information and links about there here, if you're not already aware.

CD Options here:
http://www.microsoft.com/windowsxp/pro/downloads/servicepacks/sp1/ordercd.asp
Microsoft Windows XP Service Pack 1 Installation and Deployment Guide
http://www.microsoft.com/WindowsXP/pro/downloads/servicepacks/sp1/spdeploy.asp 

Windows XP Service Pack 1 information
http://www.microsoft.com/WindowsXP/pro/downloads/servicepacks/sp1/default.asp
 
Internet Explorer 6 Service Patch 1 (CRITICAL UPDATE) was available from WindowsUpdate yesterday and highly recommended to fix significant problems.  You may wish to check WindowsUpdate directly.  Some more insights about these updates here:

http://www.microsoft.com/windows/ie/default.asp 
http://www.microsoft.com/windows/ie/evaluation/ie6sp1.asp 
The following link shows you the list of fixes included in IE 6 SP1
http://support.microsoft.com/common/canned.aspx?R=d&H=List%20of%20Fixes%20in%20Microsoft%20Internet%20Explorer%206%20SP1&LL=support&Sz=kbIE600sp1fix&Fr=&DU=&SD=GN&LN=EN-US&CND=1&VR=&CAT=&VRL=&SG=&MaxResults=150

If more is needed, please let us know.
Good luck,
":0) Asta
0
 

Expert Comment

by:slateblu
ID: 7796342
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Answered by: gavc
- Place in PAQ

Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
Thank you,

SB
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7866106
Per recommendation, force-accepted.

Netminder
EE Admin
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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

Most of the time we are in fix when all of sudden our systems behave weirdly.  Such problems cost time and effort... so it's best to take some preventive actions so that we can avoid such issues or overcome such problems more easily. Preventive M…
Can you find a fax from a vendor you saved a decade ago in seconds? Have you ever cursed your PC under your breath during an audit because you couldn’t find the requested statement or driver history?  If you answered no to the first question or yes …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
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…

735 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