Solved

Map a network drive and assign a drive letter with a batch file

Posted on 2006-11-28
5
403 Views
Last Modified: 2010-04-10
Hi

I have a program that needs a mapped drive to exist.  I have a batch file that runs each time the user logs in.  I would like to add a line that add a batch file that creates a mapped drive with a drive letter and path to my files.
I already have one in the user profile of Active directory so I need another one as a batch file.  How do you do that?

Mike
0
Comment
Question by:MickaelE
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 6

Accepted Solution

by:
ryandale56 earned 500 total points
ID: 18032555
net use Z: \\server\share

(where Z: is whatever drive letter you want)
0
 
LVL 7

Expert Comment

by:dlangr
ID: 18032560
in the batchfile add:

net use delete g:
net use g: \\server\share

You can use any letter you like, not just g, as log as it is still free.

type: net use /?   from the command line for help
0
 
LVL 7

Expert Comment

by:dlangr
ID: 18032564
log = long
0
 
LVL 6

Expert Comment

by:ryandale56
ID: 18032618
if you are going to add the "net use /delete g:"  it is /delete no just delete....notice the leading slash.
0
 

Expert Comment

by:vk3jed
ID: 18033650
I always find the method below is the most reliable

net use X: \\server\share /yes /persist:no

What this does is maps X: to \\server\share.  /yes means answer "yes" to any prompts, without stopping for user input, and /persist:no means that the share won't be persistent (remapped) at next login.  This can help with unexpected issues (e.g. if the bat file lives on a server or the server hosting the share is down at the time, it won't be mapped.  Therefore, the absence of X: can be an sign there is a problem, and you won't have Windows being bogged down by trying to access a nonexistent network drive.

Before running the batch file for the first time, make sure that the drive letter to be used is not mapped (X: in the example above).
0

Featured Post

Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
software inventory tools 3 65
Vmotion configuration 4 55
Setup small office network 1 58
cannot view videos at msnbc 12 66
PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question