Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 



Sign in to follow this  
realized

net use /user:domain\username password?

Recommended Posts

realized    0

When i "net use l: \\ip\share /user:domain\username" and press the enter key, it asks for my password, and i type it.. it works fine..

when i try to "net use l: \\ip\share /user:domain\username mypassword" or "net use l: \\ip\share mypassword /user:domain\username" i get an error.

The goal of this would be to map the drive in 1 line so i can use it in a batch script.

If i can do it in two lines via a batch script that would work also but i am not sure how.

Any help would be great!

Share this post


Link to post
Share on other sites

fizban2    0

what is the error it gives you? "bad username or password?"

net use Z: \\ip\share /user:domain\username password

that will work fine, just tested it in a batch with 3 shares, how about using the UNC equivelent of the IP?

Share this post


Link to post
Share on other sites
jftuga    0

Try putting you password inside of double-quotes. If that still dows not work, change the password to only be a combination of upper & lowercase letters and numbers.

-John

Share this post


Link to post
Share on other sites
Mordac85    0

I ran into the same problem when I had a caret (^) in my password. I recommend trying jftuga's suggestion to see if it's related to a special character being interpreted as something other than a string character.

Share this post


Link to post
Share on other sites
eyeball    0

is this being used in a login script in a domain? or just a workgroup?

net use l: \\192.168.x.x /user:domain\administrator "password"

should work perfect for domain situations

and net use l: \\192.168.x.x /user\administrator "password"

that should work for workgroups

(assuming that the local admin password on the one you are mapping the drive from is the word "password")

let us know any errors you get

thanks

Edited by eyeball

Share this post


Link to post
Share on other sites

Hi Mordac

the following is right:

net use l: \\192.168.x.x /user:domain\administrator "password"

if the password however contains a special character, try typing it twice, for example:

pw: "tr45#tr" should be "tr45##tr"

let us know

Share this post


Link to post
Share on other sites
BillB    0

I am trying to access a resource (map a hidden share) as a different user and password. I've tried all iterations including * of

net use Z: \\server\share$ /user:domain\username password

and get

System error 1219 has occurred.

Multiple connections to a server or shared resource by the same user, using more

than one user name, are not allowed. Disconnect all previous connections to the

server or shared resource and try again..

When I use net use without any password, it maps the drive, but I can't access it because I have no rights.

Is it significant that my password is password?

Share this post


Link to post
Share on other sites

From the error message you provided, it sounds like you are already connected to the server under alternate credentials. Try disconnecting from the server prior to attempting to map a drive under the other credentials. The following batch file will disconnect all mapped drives, that are not in use, then perform the drive mapping under the given credentials.


@echo off

set "svrname=server"
set "share=share$"
set "usr=administrator"
set "pwd=password"

for /f "tokens=2" %%# in ('net use^|find /i "\\%svrname%"') do net use %%# /delete>nul

net use l: \\%svrname%\%share% /user:%usr% "%pwd%">nul

Share this post


Link to post
Share on other sites
r0ckz    0
I am trying to access a resource (map a hidden share) as a different user and password. I've tried all iterations including * of

net use Z: \\server\share$ /user:domain\username password

and get

System error 1219 has occurred.

Multiple connections to a server or shared resource by the same user, using more

than one user name, are not allowed. Disconnect all previous connections to the

server or shared resource and try again..

When I use net use without any password, it maps the drive, but I can't access it because I have no rights.

Is it significant that my password is password?

disconnect (Z) before:

net use Z: /delete

make mapping:

net use Z: \\server\folder$ /user:user@domain password

P.S: this command displays the password on the screen.

att,

Share this post


Link to post
Share on other sites
Tripredacus    286
I am trying to access a resource (map a hidden share) as a different user and password. I've tried all iterations including * of

net use Z: \\server\share$ /user:domain\username password

and get

System error 1219 has occurred.

Multiple connections to a server or shared resource by the same user, using more

than one user name, are not allowed. Disconnect all previous connections to the

server or shared resource and try again..

When I use net use without any password, it maps the drive, but I can't access it because I have no rights.

Is it significant that my password is password?

disconnect (Z) before:

net use Z: /delete

make mapping:

net use Z: \\server\folder$ /user:user@domain password

P.S: this command displays the password on the screen.

att,

Yes you will get this error if you try to make 2 different connections to a single resource using two different logins. There isn't any reason why you would need two logins. If you can't add the correct permissions to the first account or the second, create a new account that can access both items.

Share this post


Link to post
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

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×