Map Network Drive across domain ... script & help needed

Guys ...

I am migrating a load of users into a new domain - but they need access to a share called 'cv' on a WORKGROUP called 'Domain' !

I would ultimately like a network drive to be mapped to this location and I assume I would script it ...

But i'm useless at these scripts and not even sure if it's possible ... if someone could write me the script (net use?) I would be appreciated ...

Let's say the users are on 'MyDomain' and need drive 'V:' mapped to a share on ..

'\\domain\fileserver1\cv' with creditials '\\domain\Administrator' and password of 'pw' ...

I hope this makes sense ...

Who is Participating?
Pete LongTechnical ConsultantCommented:
These command can be executed from either command line, Batch File OR Login Scripts

This command maps a drive "Z:\" to a shared directory on a server called "Server1"

net use z: \\server1\sharename\

If you need permissions to use this network resource toy can also enter the username and password. (See Security Below)

net use z: \\server1\sharename\ /user:username password

The above commands will work until a user logs out or the machine is rebooted, to make the mapping permanent you need to use a "Persistent switch"

net use z: \\server1\sharename\ /user:username password /Y
Lee W, MVPTechnology and Business Process AdvisorCommented:
If you have problems with Pete's version of:
net use z: \\server1\sharename\ /user:username password

net use z: \\server1\sharename\ password /user:username

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

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


Most commands can swap order of the functions in the command line - but a few don't and I've always done it password first.
SpencerSteelAuthor Commented:
OK ... this look all correct ... I think my problem lies elsewhere ... namely, I need to connect to


and DOMAIN itself wants a password - I don't think it likes anyone coming in from my domain ... if this server was on the same domain and I could browse to it easily, your method would be spot on ...

... the machine itself is an NT4 box with EVERYONE allowed (Share/Permissions) ... can't think what is obvious that I'm doing wrong.

I wonder if DFS would be better to provide credentials ?


Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Pete LongTechnical ConsultantCommented:
you dont need a domain in thew path as long as the PC can see server by itts name of <server1>

if not

net use v: \\\share <password> /

where is the IP address of server1
SpencerSteelAuthor Commented:
OK ... I can hear everyone muttering 'idiot' under their breath ... and I'm with you ... this all makes sense ... but I think the problem is no longer in the script ...

First of all, the error i'm getting back is basically 'The network name cannot be found' - which is true - it can't ... read on ...

1. As a Administrator from MyNewDomain, using Windows Explorer, I can browse to DOMAIN\Server1 ... but there it stops (no shares can be seen) and asks for Credentials, which I can provide as '\\DOMAIN\Administrator' & 'thepassword' ... then I can see all the shares I might like to connect to - as you would expect.

2. A 'normal' user from my domain does not get challenged at the DOMAIN level ... thus they will never 'see' the share.

So, my problem now isn't really one of scripting/mapping the drive ... it's showing the share from the old domain, so users on the new one can 'see' it.

I think.

I thinking that if the users could 'browse' to the CV folder, the mapping thing will be easy - as your scripts are bang on ... I'm just trying to wrap my head around what "Server1\cv" needs for it's shares to be browseable by users on the NewDomain ...


Pete LongTechnical ConsultantCommented:
>> I can hear everyone muttering 'idiot' under their breath

No one thinks that we are here to help :)

your on two domains that dont trust each other - that being said a computer on domain a cant see a computer on domainb (cause the domains use different DNS - DONT confuse internet DNS with NT Domain DNS - they just look similar :)

still assuming server1 is at

from the pc on the OTHER domain can you


and get a response, if so

net use v: \\\share <password> /

should get you on
Pete LongTechnical ConsultantCommented:
Ive just tried it on my home domain from a workgrouped PC and it worked?
SpencerSteelAuthor Commented:
I am an idiot ... and you are helping ... my statement above (2) was incorrect ... i *can* map - via windows XP - to the share from any user.

Therefore, my scripting must be wrong.

I will hand out points now - as you've all been helpful and get to work on this now !

Thanks so much,


(facing manual mapping task, he fears.)
Pete LongTechnical ConsultantCommented:
<grin> It never stops it dont matter how much tech you know - theres allways something more complicated and more freaking scary LOL - thats why the experts here dont thing of posters as idiots (well there are a few but thats the eception to the rule mate)

keep us posted
SpencerSteelAuthor Commented:


*runs screaming*

OK - we are there - solved.

So sorry !!!!!!!

Pete LongTechnical ConsultantCommented:
ThanQ - I'll stay subscribed in case it all explodes in balls of flames <grin>
Pete LongTechnical ConsultantCommented:
>>So sorry !!!!!!!

I can remember doing the same myself in the past - I'll lay good money you never make that mistake again - glad you are fixed, and thanks again

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.

All Courses

From novice to tech pro — start learning today.