Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"net use" command for XP users

Status
Not open for further replies.

mandg

Technical User
Jun 7, 2002
83
0
0
US
I have a question with mapping drives through the use of batch files. We currently have it set up to just use the "net use" command and this works fine on our network which is mostly w2k users. However, I've learned that XP users are required to prefix their login name with the domain. So the username ends up looking something like this: domain/username

My question is how do I change the batch file to where I can include this domain automatically?

Here's the current syntax;

net use y: /d
net use y: \\10.1.16.7\installs /PERSISTENT:NO

Thanks.
 
From the net use help:

C:\>net use /?
The syntax of this command is:


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}]]

NET USE {devicename | *} [password | *] /HOME

NET USE [/PERSISTENT:{YES | NO}]

So in your case:
net use y: \\10.1.16.7\installs /user:domain\username /persistent:no
 
Thanks for the follow up. I had actually tried this earlier but my situation is not as simple. What I'm trying to do is automate the script company-wide so that the drives get mapped seamlessly. I am doing this on two servers, both running W2k. For some reason, the script works on one of the servers and the drives get mapped. However the other server, prompts for a username (and requires that the username get prefixed with the domain) and password.

The base factor in this entire issue is that the script acts like this on XP client machines. The rest of the company that runs on W2k clients has no problems with mapping to the W2k servers.

Can this be remedied through our existing use of batch scripts for the XP users? Again, I'm looking for automation so configuring individual batch scripts with each XP users login name/password will not work. Hopefully (and easier too), there's something I can change on the troubelsome W2k server to allow the mappings...
 
The only reason I know of this normally is if the server or client isn't in the correct domain environment. Are you sure that they all belong to the same domain? Do each of the XP pc's have computer accounts on the W2K servers?
 
well, you could try putting in DOMAIN\%USERNAME% ... haven't tried myself, but the theory is sound :)

~Intruder~
CEH, MCSA/MCSE 2000/2003

"The Less You Do, The Less Can Go Wrong" :)
 
Thanks SimonDavies- I'll look into that.

NetIntruder, you are correct that the syntax DOMAIN\%USERNAME% will capture the local logon name but then I'll still need the users password. And as far as I know, there's no way to automate that, correct?
 
none that i'm aware of... but I'm with Simon on this one. If a user has a valid domain account and has access to the resource you are mapping, you should not be getting prompted. That is the issue we should be researching - applying the username/password seems to be more of a bandaid :)



~Intruder~
CEH, MCSA/MCSE 2000/2003

"The Less You Do, The Less Can Go Wrong" :)
 
Just wanted to update this thread with the final outcome. Turns out that the XP systems in which I was having these problems came bundled with McAfee Personal VirusScan and Firewall programs. For some reason, these programs would tear down some of the mappings that the batch file created during the login process. Once I de-installed those programs, and thereafter installed the standard McAfee program that we use (Enterprise version 8.0) these mappings stayed and worked perfectly.

So, again, not sure what the exact culprit was, but this is something to check if anyone else experiences this issue.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top