[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 405
  • Last Modified:

Network drive mapped but not showing the name. ODD

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
HB-IT
Asked:
HB-IT
  • 3
1 Solution
 
MikeIT ProfessionalCommented:
change i, r, n, o, w, v, m, p to Capital Letters just for the heck of it....
0
 
joeyfazCommented:
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
 
joeyfazCommented:
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
 
joeyfazCommented:
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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now