Solved

How to map a print queue inside command prompt?

Posted on 2002-05-15
9
542 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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 

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

Disclosure: Use this tutorial only when no other options helps to get Windows XP running without any problems and you don't want to format the drive. The back up of the data is the responsible of the user, however there is a description of how t…
We have adopted the strategy to use Computers in Student Labs as the bulletin boards. The same target can be achieved by using a Login Notice feature in Group policy but it’s not as attractive as graphical wallpapers with message which grabs the att…
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

636 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