Solved

How to map a print queue inside command prompt?

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

Author Comment

by:keywaitao
ID: 7072474
Is this the command "capture" just exists in Win XP?
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ROOT\*0700\1_0_13_0_0_0 8 143
Toshiba Satellite 5 147
Windows Web Server Permissions question ... 1 68
Clone HDD in RAID1 10 120
If you build your web application in Visual Studio you'll get at least a few binaries, or .DLL, files in your bin folder. However, there is more compiling to be done. Normally this would happen when an ASP.NET resource within the web site is request…
Ok I have been working on this for some time having learned and gained certification in XenDesktop 4 along came version 5 which was released last month. Since then I have been working to deploy XenDesktop 5 in a small environment with only 2 virt…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

919 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

20 Experts available now in Live!

Get 1:1 Help Now