Solved

Network drive mapped but not showing the name.  ODD

Posted on 2011-09-02
4
389 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Can I legally transfer my OEM version of Windows to another PC?  (AKA - Can I put a new systemboard in my OEM PC?) Few of us are both IT and legal experts but we all have our own views of Microsoft's licensing rules and how they apply.  There are…
On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

809 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