How do I insert a user name in a UNC file path?

  • Thread starter Thread starter ToddAndMargo
  • Start date Start date
T

ToddAndMargo

Hi All,

I have a customer with a mixed Linux XP network. When
I go to administer things on the server, with Linux I can
state the user name in the path:

smb://foo@server/drivers

I will be asked for the password for foo and happy
camping starts. This is really useful for adding
things to private shares.

Question: in Windows Explorer (not Internet Explorer),
is there a way to do this with XP? How do I stick
the username into the UNC path?

Many thanks,
-T
 
Hi All,

I have a customer with a mixed Linux XP network. When
I go to administer things on the server, with Linux I can
state the user name in the path:

smb://foo@server/drivers

I will be asked for the password for foo and happy
camping starts. This is really useful for adding
things to private shares.

Question: in Windows Explorer (not Internet Explorer),
is there a way to do this with XP? How do I stick
the username into the UNC path?

Many thanks,
-T

I'm not sure if there is an equivalent in windows, but I can tell you to
drop to a command prompt in windows and read the help for the net use
command (net use /?) and see if that will help you.
 
Hi All,

I have a customer with a mixed Linux XP network. When
I go to administer things on the server, with Linux I can
state the user name in the path:

smb://foo@server/drivers

I will be asked for the password for foo and happy
camping starts. This is really useful for adding
things to private shares.

Question: in Windows Explorer (not Internet Explorer),
is there a way to do this with XP? How do I stick
the username into the UNC path?

Many thanks,
-T

To my knowledge, you can only specify a user with the command line "net
user" command. Try placing the following two lines into a '.bat' file
and double-click on it.

net use \\server\share /user:username
explorer \\server\share

Where you replace "server" with your server name, "share" with the
share name, and "username" with your username.

HTH,
John
 
I'm not sure if there is an equivalent in windows, but I can tell you to
drop to a command prompt in windows and read the help for the net use
command (net use /?) and see if that will help you.

Thank you.

Once "Net Use" has a user name, it sticks with it. I do not
get to mix and match. I also wanted to surf the various shares
with the UNC and be able to pick which user name I browser which
shares with. This is really easy to do with Linux. I was
hoping XP had an equivalent.

-T
 
To my knowledge, you can only specify a user with the command line "net
user" command. Try placing the following two lines into a '.bat' file
and double-click on it.

net use \\server\share /user:username
explorer \\server\share

Where you replace "server" with your server name, "share" with the
share name, and "username" with your username.

Rats!

Thank you for the response.

-T
 
Once "Net Use" has a user name, it sticks with it. I do not
get to mix and match. I also wanted to surf the various shares
with the UNC and be able to pick which user name I browser which
shares with. This is really easy to do with Linux. I was
hoping XP had an equivalent.

It's not just "net use". Windows *by design* will only allow one
authentication per connected server. If you connect to a share using
one authentication -- no matter how you do it -- you cannot connect
to a different share on that same server using a different
authentication until/unless you disconnect the first connection. You
will either have to do a "net use [...] /delete", right-click on "My
Network Places" and choose "Disconnect Network Drive" (even if not
mapped), or wait until the non-mapped idle connection times out (~15
min).

Quoting from "INFO: WNetAddConnection2 and Multiple User Credentials"
<http://support.microsoft.com/kb/183366/>

<quote>
"In Windows NT, on the other hand, you can use the API with multiple
sets of user credentials. However, one major limitation applies,
namely, that connections to a given server or its shared resources
have to be made within the context of a single set of credentials. "
</quote>

Score 1 for Linux.

HTH,
John
 
Once "Net Use" has a user name, it sticks with it. I do not
get to mix and match. I also wanted to surf the various shares
with the UNC and be able to pick which user name I browser which
shares with. This is really easy to do with Linux. I was
hoping XP had an equivalent.

It's not just "net use". Windows *by design* will only allow one
authentication per connected server. If you connect to a share using
one authentication -- no matter how you do it -- you cannot connect
to a different share on that same server using a different
authentication until/unless you disconnect the first connection. You
will either have to do a "net use [...] /delete", right-click on "My
Network Places" and choose "Disconnect Network Drive" (even if not
mapped), or wait until the non-mapped idle connection times out (~15
min).

Quoting from "INFO: WNetAddConnection2 and Multiple User Credentials"
<http://support.microsoft.com/kb/183366/>

<quote>
"In Windows NT, on the other hand, you can use the API with multiple
sets of user credentials. However, one major limitation applies,
namely, that connections to a given server or its shared resources
have to be made within the context of a single set of credentials. "
</quote>

Score 1 for Linux.

HTH,
John


Hi John,

Thank you for the scholarly explanation. You are an excellent
technical writer. I was hoping I was just ignorant and could
actually do what I wanted.

Since I live in both the Linux and Windows world (sometimes
Apple too), I am always finding things in one I would like to
see in the other. And, sometimes, I think my head is
going to explode. :'(

-T
 
Back
Top