Jump to content

Can you map a usb printer to a computer using...


Cytomax
 Share

Recommended Posts

Hello all i have a small network with 1 server Windows 2003, Standard and 5 clients WinXP Pro connected to a switch on a domain with 1 lpt printer that is shared throughout the network... I currently have the lpt printer mapped out on all the clients using the following command

net use lpt1: \\server\printer /Persistent:yes

Now i would like to know is there a net use command to keep a persistent connection with a usb printer attatched to the sever just like the lpt one.

Thanks in Advance

Eddie

Link to comment
Share on other sites


mean of connection to the printer doesn't matter at all since you have to create a port that users will use to print to, so printer can be connected as lpt, com, usb or ethernet :)

Link to comment
Share on other sites

exactly...

so long as the share name (\\server\printersharename) is correct, it should be fine.

You might want to look up the kixtart scripting way of doing things - works great for me with servers set up on the server and shared for users to print using....

http://www.kixtart.org/

http://www.scriptlogic.com/Kixtart/htmlhel...ord-index.asp#A

I cant provide an example at the moment as I'm off work after an operation, but in 3-4 weeks, I might be able to help you further with it.

Regards,

N.

Link to comment
Share on other sites

Thanks for the info but im still a little confused.. are you telling me i can type in

net use lpt1: \\server\LPTprinter /Persistent:yes

for the LPT printer

and

net use lpt1: \\server\USBprinter /Persistent:yes

for the usb printer

and this will work fine... it doesnt matter if i use lpt1 or lpt2 or usb in the command?

Thanks for the replies btw

Eddie

Link to comment
Share on other sites

cant say for sure 100% as i use the kixtart script in logging on which is soooo much better but yeah, theoretically, it shouldnt matter what the port is called on the client machine.

With XP, domains and printers, me and my colegues in the other schools use kixtart for attaching printers in the logon scripts so i'm not sure you see, having never done it any other way.

You can try it, but your best bet would be to try the kixtart way if u have time to have a play with it.

cheers,

Nath

Link to comment
Share on other sites

Thanks for the info but im still a little confused.. are you telling me i can type in

net use lpt1: \\server\LPTprinter /Persistent:yes

for the LPT printer

and

net use lpt1: \\server\USBprinter /Persistent:yes

for the usb printer

and this will work fine... it doesnt matter if i use lpt1 or lpt2 or usb in the command?

Thanks for the replies btw

Eddie

I would strongly reccomend not to use batch files as logon scripts, but use vbs ... anyway, the port that you map on the workstation using logon script doesn't matter, as long as there is no local printer installed and connected to lpt1, and yes you can map usb printer that is connected on the server, to lpt1 port on the workstation ... here is an example of printer connection using vbs

Dim net
Set net = CreateObject("WScript.Network")
net.AddWindowsPrinterConnection "\\Server\HPLJ4", "HPLJ4"

word Server replace with your actual server name, HPLJ4 is the name of the port on the server

this is how you set default printer using vbs

Set net = CreateObject("WScript.Network") 
net.SetDefaultPrinter "\\Server\HPLJ4"

if you wonder how to map drives using vbs here is an example

Dim WshNetwork
Set WshNetwork = WScript.CreateObject("WScript.Network")
WshNetwork.MapNetworkDrive "Q:", "\\Server\SharedFolder"

and to map user home folders use this Note:you must remove home mappings from user properties in Active Directory users and Computers if any is there![b/]

' VBScript.
' Mapping user home folder on the server
Dim oNet, sUser

Set oNet = CreateObject("Wscript.Network")

sUser =oNet.UserName

oNet.MapNetworkDrive "P:", "\\Server\" & sUser

The map user home folder should actually be the first lines of the code in the script so it looks like this

' VBScript.
' Mapping user home folder on the server
Dim oNet, sUser

Set oNet = CreateObject("Wscript.Network")

sUser =oNet.UserName

oNet.MapNetworkDrive "P:", "\\Server\" & sUser

Dim WshNetwork
Set WshNetwork = WScript.CreateObject("WScript.Network")
WshNetwork.MapNetworkDrive "Q:", "\\Server\SharedFolder"



Dim net
Set net = CreateObject("WScript.Network")
net.AddWindowsPrinterConnection "\\Server\HPLJ4", "HPLJ4"


Set net = CreateObject("WScript.Network")
net.SetDefaultPrinter "\\Server\HPLJ4"

Remember to save the script as vbs file (*.vbs)

Link to comment
Share on other sites

not to start flaming, but you didnt explain why you recomend not using batch files in logon scripts...

Easy to use, understand and alter.

kixtart scripting is not the same as a batch file but is run from a batch file with one command. Some of the commands look very similar to vbs but its alot simpler and works a treat.

But each to their own of course... :)

If you need a hand with batch/kixtart scripting for the task you asked about, feel free to PM me :)

Regards,

Nath.

Link to comment
Share on other sites

Just because VBS can do more stuff than batch file can ... just for a start to map user home folder os much more complicated using batch file (writing it by hand and not third party program) ... and again, that's my personal reccomendation

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.


×
×
  • Create New...