Solved

Network drive mapped but not showing the name.  ODD

Posted on 2011-09-02
4
395 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
[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
  • 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

It is only natural that we all want our PCs to be in good working order, improved system performance, so that is exactly how programs are advertised to entice. They say things like:            •      PC crashes? Get registry cleaner to repair it!    …
When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
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…

717 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