Startup Script to Map Drives

June 10, 2009 at 08:39:44
Specs: Windows Vista
I have two Vista computers who need reconnect to mapped drives on startup. The problem is that sometimes the server connection is not ready in time for the mapped drives to reconnect. So I get "network drives failed to connect" message. The only way at that point to get them to reconnect is to remap the drives or I have written a batch script that will reconnect them but it has to be manually started.

What I would like to do is write a startup script that will loop and continue to attempt to reconnect the mapped drives every 5 or 10 seconds until the mapping is successful. Then the loop should break and then the script terminates.

I am connecting to 2 drives on the same server. For example, one drive I am mapping is the X: drive and it is located at \\server\programx. I don't need to put in a username and password every time. I only need the script to attempt to map the drives until the task is successful. Any help would be greatly appreciated as I am a complete novice at script writing.

See More: Startup Script to Map Drives

Report •

June 10, 2009 at 09:11:52
You should be addressing the server / network issue instead of writing scripts to "make things work".

For example have you confirmed name resolution is working? This problem is the usual reason for delays.

A script request is best placed in the programming forum

Report •

June 13, 2009 at 09:15:09
Are you using a Windows 2000, 2003 or 2008 server?
Also are you running a Domain with Active Directory?

If so, within the \\servername\NETLOGON share create a login script. Simplest method is a batch file. Use net use Z: \\servername\share command to set mapped drive (sounds like you may already be doing this in your manual script).

You can then either set this login script to run by configuring the login script section of the Active Directory user account properties, or as I prefer, through the login script section of an Active Directory Group Policy. I find the latter more reliable.

Hope this helps.

IT Services Manager

Report •

Related Solutions

Ask Question