Solved

Network drive mapped but not showing the name.  ODD

Posted on 2011-09-02
4
375 Views
Last Modified: 2012-08-14
hello I am having one of the oddest issues with mapping network drives.  On some of our computers xp and vista.  I have an active directory server that runs a bat file to map the network drives when they log in as seen below my question.  But what it does sometimes is it wipes out the info that it shows for the "name"  and calls it Network Name....  how do I fix this issue so it shows the name of the true drive.

Echo off
CLS

ECHO Map Corporate Images Drive
NET USE i: \\hbspectrum\images /PERSISTENT:NO

ECHO Map Corporate Residential Drive
NET USE r: \\hbfipr\public\residential /PERSISTENT:NO

ECHO Map Corporate Residential Drive
NET USE n: \\hbfipr\public\svr /PERSISTENT:NO

ECHO Map Corporate CommSVC Drive
NET USE o: \\hbfipr\public\commsvc /PERSISTENT:NO

ECHO Map Corporate Warehouse Drive
NET USE w: \\hbfipr\public\warehouse /PERSISTENT:NO

ECHO Map Corporate Commercial Drive
NET USE v: \\hbfipr\public\vault /PERSISTENT:NO

ECHO Map Corporate Administration Drive
NET USE m: \\hbfipr\public\admin /PERSISTENT:NO

ECHO Map Corporate NorthBoundary Drive
NET USE p: \\hbnorth\northboundary /PERSISTENT:YES
0
Comment
Question by:HB-IT
  • 3
4 Comments
 
LVL 12

Expert Comment

by:Mike
ID: 36475172
change i, r, n, o, w, v, m, p to Capital Letters just for the heck of it....
0
 
LVL 6

Accepted Solution

by:
joeyfaz earned 500 total points
ID: 36478431
I just made this vb code for you, it should work as needed. Let me know otherwise
Dim i, d, v, m
Dim mDrive(7)

Set oShell = CreateObject("Shell.Application")
Set oNet = CreateObject("WScript.Network")
Set d = oNet.EnumNetworkDrives

'Directions:
'1) Use format: "D: <-Drive letter with colon, \\server\folder <-UNC path, Description <-Don't use commas or any special characters
mDrive(0)="I:,\\server\Share,Map Corporate Images Drive"
mDrive(1)="R:,\\server\Share,Map Corporate Residential Drive"
mDrive(2)="N:,\\server\Share,Map Corporate Residential Drive"
mDrive(3)="O:,\\server\Share,Map Corporate CommSVC Drive"
mDrive(4)="W:,\\server\Share,Map Corporate Warehouse Drive"
mDrive(5)="V:,\\server\Share,Map Corporate Commercial Drive"
mDrive(6)="M:,\\server\Share,Map Corporate Administration Drive"
mDrive(7)="P:,\\server\Share,Map Corporate NorthBoundary Drive"

For i=0 To 7
v=Split(mDrive(i),",")
For m=0 To (d.Count-1) Step 2
'Check if above indicated mapped drives are in use and then remove them
If d.Item(m)=v(0) Then
WScript.Echo d.Item(m) & " = " & v(0) & vbCrLf
oNet.RemoveNetworkDrive v(0)
End If
Next
'Map the drives and then label them
oNet.MapNetworkDrive v(0), v(1)
oShell.NameSpace(v(0)).Self.Name=v(2)
Next

Set oShell=Nothing
Set oNet=Nothing

Open in new window

0
 
LVL 6

Expert Comment

by:joeyfaz
ID: 36478437
Comment out WScript.Echo d.Item(m) & " = " & v(0) & vbCrLf with a ' if you don't want to know which mapped drives were removed
0
 
LVL 6

Expert Comment

by:joeyfaz
ID: 36481821
Copy the code to a text document, change the extension to .vbs and include it as a logon script on the domain.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

If your system is showing symptoms of browser hijacks or 'google search redirects' check out my other article (http://rdsrc.us/u3GP7A) first and run the tool TDSSKiller (http://rdsrc.us/GDBBs4) to get rid of the infection. Once done, and if the …
If you have done a reformat of your hard drive and proceeded to do a successful Windows XP installation, you may notice that a choice between two operating systems when you start up the machine. Here is how to get rid of this: Click Start Clic…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now