# Mapped Network Drives not reconnecting at logon



## tristan1407

Hi

I am running a workgroup with 4 XP Pro machines and a W2k3 Files Server, I have a number of mapped network drives associated with shared databases for a locally run applicaton on each machine. Although I have the box ticked to map the network drive at logon - the drives show as disconnected when the machines start, until I double click the drive and put in a password to connect.

I want to use a script to automatically logon to the drives at startup, and the drives are accessedd using a different username and password to the local user settings.

Firstly - is it possible to create a logon script to achieve this and secondly - is the reason the mapped drives are not reconnecting at startup (even though I have entered the details to logon as a specific user and password when I originally mapped the drive and ticked the box) because the local user is different to the permissions for the file share on the server.

Can anyone help here??
Tris:4-dontkno


----------



## Squashman

Basically yes. You should really sync all the usernames and passwords. makes it alot easier to maintain.

But you may still be able to do it with a batch file and the *net use* cmd. Just use the */savecred* switch at the end.


----------



## tristan1407

*Creating the batch file - where do I start*

Thanks for your reply, I have tried a batchfile but got lost tring to add the password to the logon parameter....

For the untrained - can you walk me through what the batch file should contain to allow me to logon as in my previous thread using the parameters you have identified???

Your help is greatly appreciated.


----------



## Squashman

You don't really need a login script or batch file to do this. Just really need to run this once if you save the credentials.



Code:


net use D: \\computer_name\share_name users_password /user:username /persistent:y /savecred

If you just type


Code:


net use D: \\Computer_name\share_name /savecred /persistent:y

 You should be prompted to enter in the username and password.


----------



## tristan1407

Ok - for the completely untrained here, I understand the process but can't see how the system will interpret what I'm trying to achieve from what you have advised.

Put simply - I still can't get it to work....

I'm mapping a T: to \\Ddraig\Technical using username Ddraig\RDITSAdmin and password admin, how do I simply set up the machine to automatically log onto the map drive a boot

Can you interpret what I'm trying to do into what it is you are advising... I really appreciate your assistance!!!!:4-dontkno


----------



## Squashman

The two switches. /savecred /persisten:y

This will save the username and password used to access the share and the persisitent will keep the mapping for next time the user logs in.

Could you please post the exact syntax you are trying to use. You also said that this was a workgroup in your first post. Are they computers in a workgroup or is the Server setup with AD as a domain controller.


----------



## tristan1407

Hi

Thanks for coming back...

As I said in the first thread - I've set up a very simple file share network with a W2k3 Server as the File Server and 2 XP Pro SP2 on a workgroup called RDITS.

The syntax I'm attempting to use is:

@Echo Off
C:\WINDOWS\System 32\Net.exe use T: \\Ddraig\Technical admin /user:RDITSAdmin /persisten:y /savecred 

The above is created in notepad, saved as a .bat file on the root of C: with a shortcut in the Startup directory.

Where am I going wrong.... I know its blindingly obvious......


----------



## Squashman

Try running it from a cmd prompt first to test it.

You don't need to use the path to net command. It should be in the path. Plus I spelled persistent wrong. If you do it from a cmd prompt first it will show you any error messages.

Net use T: \\Ddraig\Technical admin /user:RDITSAdmin /persistent:y /savecred

It really doesn't need to be in the Startup Directory because we are using the persistent and savecred switches.


----------



## gamerman0203

try this to make it easier on yourself in the long run. Set up a domain on the win2k3 server. Add the the two usernames to the active directory, then log in to both xp machines and switch it over from workgroup to your domain. Once on the domain, remap the drives if necessary and they will reconnect everytime. Your problem is because you probably aren't users on the server.


----------



## tristan1407

Ureaka
Ok - got it to work, but the /savecred sysntax threw up an error, created a .bat file and located in startup and all good - many many thanks.

It would have been simple to create the whole thing in Active Directory and managed through a domain, but its for a very simple network where I didn't want to throw in a domain controller....


----------



## prash.soni9

tristan1407 said:


> Ureaka
> Ok - got it to work, but the /savecred sysntax threw up an error, created a .bat file and located in startup and all good - many many thanks.
> 
> It would have been simple to create the whole thing in Active Directory and managed through a domain, but its for a very simple network where I didn't want to throw in a domain controller....


Tris, can you post the exact code you used in the .bat file? 
I tested the syntax in cmd as per squashman's suggestion and it showed the command was successful but upon restarting it showed disconnected drive & required logon.
I also saved the .bat file in startup as per tristan as below:
net use O: \\computername\shareddrive /user:username password
Do I need to add /savecred /persistent:yes in that order to the above syntax?
FYI, mine is 2k3 server and 6 WinXP SP2 client machines + 1 Vista HE. The problem is just on XP SP2 laptop connecting wirelessly.


----------



## zoomsta

If you just type


Code:


net use D: \\Computer_name\share_name /savecred /persistent:y

 You should be prompted to enter in the username and password.[/QUOTE]


> Awesome! This worked like a charm! Thanks!


----------



## 2xg

Thanks for the feedback. 

This is an old Thread and need to be Closed.


----------

