Net Use command (Connect to network printer)

I know how to use the Net Use command to connect to a network printer.  Now I have the following problem:

One Windows 2000 workstation (Not a domain network) needs to connect to a shared local printer on another Windows 2000 workstation.  And I need a script to run on bootup or login that uses the correct username and password for this connection.  Here is somewhat of an idea of what I'm trying to do, though this doesn't work:

Net Use \\office1\HPLaser Username Password
LVL 4
HKComputerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

bstrauss3Commented:
I don't have 2K running anymore, but the syntax for XP is this:

NET USE
[devicename | *] [\\computername\sharename[\volume] [password | *]]
        [/USER:[domainname\]username]
        [/USER:[dotted domain name\]username]
        [/USER:[username@dotted domain name]
        [/SMARTCARD]
        [/SAVECRED]
        [[/DELETE] | [/PERSISTENT:{YES | NO}]]

So you should probably try

net use \\office1\HPLaser password /USER:username

-----Burton
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
HKComputerAuthor Commented:
Do you need to use the devicename?
0
bstrauss3Commented:
No, it's optional (note the []s).

-----Burton
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

adamdrayerCommented:
It is optional, but if the software requires a local device like lpt1 or lpt2, then you'll have to use the devicename
0
HKComputerAuthor Commented:
This solution does not work.  I tried the following from the command line (cmd):

net use \\office1\HPLaser password /USER:username

It brings up the help screen to inform me of the proper syntax.
0
bstrauss3Commented:
Maybe the syntax changed between 2K and XP.  What does net help use show?

-----Burton
0
HKComputerAuthor Commented:
I seem to have it working now.  I'm now using uppercase for USER.  That is the only thing I changed.  I also have it in a batch file instead of running it manually from the command line.  I'm not sure where the hiccup was/is.

Thanks -HK
0
bstrauss3Commented:
The net help use does show it in UPPER case.  Maybe that's actually required... which is weird but not the weirdest.

Glad it's working!

-----Burton
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Networking

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.