How do I change the label of a mapped network drive
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
How do I change the label of a mapped network drive

 
Post new topic   Reply to topic    Windows Server Forum Index -> Programming
Author Message
papejack
Guest





Posted: Thu Jan 06, 2005 3:33 am    Post subject: How do I change the label of a mapped network drive Reply with quote

Hi,

We have many mapped drive and we use to change the label they have via some
REG files and the REG.EXE tool.

I want to change the label WITHOUT these REG files and the REG.EXE tools. To
do that, I need to modify a binary value in the registry that you find here :

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\Z\_LabelFromReg --> Cache

I tried this:
-----------------------------------------------------------------------------------
Set WSHReseau = CreateObject("WScript.Network")
WSHReseau.MapNetworkDrive "Z:", "\\server\share$", False

'Binary Value = "Desy"
BinaryValue =
4400e9007300790000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Set WshShell = CreateObject("WScript.Shell")
WshShell.Regwrite
"HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\Z\_LabelFromReg\Cache", BinaryValue, "REG_BINARY"
Set WshShell = Nothing
----------------------------------------------------------------------------------
Since it doesn't work, I tried this:

BinaryValue =
"hex:44,00,e9,00,73,00,79,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00"

Well, I'm asking and I hope you will help me !
thanks
--
Jack
Back to top
Marty List
Guest





Posted: Thu Jan 06, 2005 9:56 am    Post subject: Re: How do I change the label of a mapped network drive Reply with quote

"papejack" <papejack@discussions.microsoft.com> wrote in message
news:7C1884FD-6794-486E-963B-16463D270C80@microsoft.com...
Quote:
Hi,

We have many mapped drive and we use to change the label they have via
some
REG files and the REG.EXE tool.

I want to change the label WITHOUT these REG files and the REG.EXE tools.
To
do that, I need to modify a binary value in the registry that you find
here :

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\Z\_LabelFromReg
--> Cache

I tried this:
-----------------------------------------------------------------------------------
Set WSHReseau = CreateObject("WScript.Network")
WSHReseau.MapNetworkDrive "Z:", "\\server\share$", False

'Binary Value = "Desy"
BinaryValue =
4400e9007300790000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Set WshShell = CreateObject("WScript.Shell")
WshShell.Regwrite
"HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\Z\_LabelFromReg\Cache",
BinaryValue, "REG_BINARY"
Set WshShell = Nothing
----------------------------------------------------------------------------------
Since it doesn't work, I tried this:

BinaryValue =
"hex:44,00,e9,00,73,00,79,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00"

Well, I'm asking and I hope you will help me !
thanks
--
Jack


I haven't used this, but it's worth a try:

http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/shell_basics/shell_basics_extending/icon.asp


With Shell versions 5.0 and later, you can also add a custom label. Custom
drive icons and labels are normally used for removable mass storage devices,
such as tape drives, to allow users to easily distinguish them from their
system's hard and floppy drives.
To replace the standard drive icon with a custom icon in Windows 2000, add a
subkey named for the drive letter to the following key.

HKEY_CLASSES_ROOT
Applications
Explorer.exe
Drives

To replace the standard drive icon with a custom icon in all versions of
Windows other than Windows 2000, add a subkey named for the drive letter to
the following key.

HKEY_LOCAL_MACHINE
Software
Microsoft
Windows
CurrentVersion
Explorer
DriveIcons

The drive letter should not be followed by a colon (:). Add a DefaultIcon
subkey to the drive letter subkey and set its default value to a string
containing the location of the icon. The first part of the string contains
the fully-qualified path of the icon's file. If there is more than one icon
in the file, the path is followed by a comma, and then by the zero-based
index of the icon. If you are using Windows Millennium Edition (Windows Me)
or later, add a custom label by adding a DefaultLabel subkey to the drive
letter subkey, and setting its default value to a string containing the
label.

The following example specifies a custom icon and label for the E: drive.
The icon is in the C:\MyDir\MyDrive.exe file with a zero-based index of
three.

For Windows 2000:

HKEY_CLASSES_ROOT
Applications
Explorer.exe
Drives
E
DefaultIcon
(Default) = C:\MyDir\MyDrive.exe,3
DefaultLabel
(Default) = MyDrive

For all other versions of Windows:

HKEY_LOCAL_MACHINE
Software
Microsoft
Windows
CurrentVersion
Explorer
DriveIcons
E
DefaultIcon
(Default) = C:\MyDir\MyDrive.exe,3
DefaultLabel
(Default) = MyDrive

Note The DefaultLabel key was introduced in Windows Me and Windows 2000. It
should not be used with earlier versions of Windows.
Back to top
papejack
Guest





Posted: Thu Jan 06, 2005 8:33 pm    Post subject: Re: How do I change the label of a mapped network drive Reply with quote

Hi,

I tried your tips, but it doesn't work, We have a Windows 2000 envirronment.
I tried the WinXP registry key, but no more success

The only place I found is in the key describe below, and the value is a
binary value

need to change that value please help !

Jack

"Marty List" wrote:

Quote:

"papejack" <papejack@discussions.microsoft.com> wrote in message
news:7C1884FD-6794-486E-963B-16463D270C80@microsoft.com...
Hi,

We have many mapped drive and we use to change the label they have via
some
REG files and the REG.EXE tool.

I want to change the label WITHOUT these REG files and the REG.EXE tools.
To
do that, I need to modify a binary value in the registry that you find
here :

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\Z\_LabelFromReg
--> Cache

I tried this:
-----------------------------------------------------------------------------------
Set WSHReseau = CreateObject("WScript.Network")
WSHReseau.MapNetworkDrive "Z:", "\\server\share$", False

'Binary Value = "Desy"
BinaryValue =
4400e9007300790000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Set WshShell = CreateObject("WScript.Shell")
WshShell.Regwrite
"HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\Z\_LabelFromReg\Cache",
BinaryValue, "REG_BINARY"
Set WshShell = Nothing
----------------------------------------------------------------------------------
Since it doesn't work, I tried this:

BinaryValue =
"hex:44,00,e9,00,73,00,79,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00"

Well, I'm asking and I hope you will help me !
thanks
--
Jack


I haven't used this, but it's worth a try:

http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/shell_basics/shell_basics_extending/icon.asp


With Shell versions 5.0 and later, you can also add a custom label. Custom
drive icons and labels are normally used for removable mass storage devices,
such as tape drives, to allow users to easily distinguish them from their
system's hard and floppy drives.
To replace the standard drive icon with a custom icon in Windows 2000, add a
subkey named for the drive letter to the following key.

HKEY_CLASSES_ROOT
Applications
Explorer.exe
Drives

To replace the standard drive icon with a custom icon in all versions of
Windows other than Windows 2000, add a subkey named for the drive letter to
the following key.

HKEY_LOCAL_MACHINE
Software
Microsoft
Windows
CurrentVersion
Explorer
DriveIcons

The drive letter should not be followed by a colon (:). Add a DefaultIcon
subkey to the drive letter subkey and set its default value to a string
containing the location of the icon. The first part of the string contains
the fully-qualified path of the icon's file. If there is more than one icon
in the file, the path is followed by a comma, and then by the zero-based
index of the icon. If you are using Windows Millennium Edition (Windows Me)
or later, add a custom label by adding a DefaultLabel subkey to the drive
letter subkey, and setting its default value to a string containing the
label.

The following example specifies a custom icon and label for the E: drive.
The icon is in the C:\MyDir\MyDrive.exe file with a zero-based index of
three.

For Windows 2000:

HKEY_CLASSES_ROOT
Applications
Explorer.exe
Drives
E
DefaultIcon
(Default) = C:\MyDir\MyDrive.exe,3
DefaultLabel
(Default) = MyDrive

For all other versions of Windows:

HKEY_LOCAL_MACHINE
Software
Microsoft
Windows
CurrentVersion
Explorer
DriveIcons
E
DefaultIcon
(Default) = C:\MyDir\MyDrive.exe,3
DefaultLabel
(Default) = MyDrive

Note The DefaultLabel key was introduced in Windows Me and Windows 2000. It
should not be used with earlier versions of Windows.



Back to top
Torgeir Bakken (MVP)
Guest





Posted: Thu Jan 06, 2005 10:58 pm    Post subject: Re: How do I change the label of a mapped network drive Reply with quote

papejack wrote:

Quote:
Hi,

We have many mapped drive and we use to change the label they have via some
REG files and the REG.EXE tool.

I want to change the label WITHOUT these REG files and the REG.EXE tools.
Hi


A VBScript that works for both local and network drives:

sDrive = "I:\" ' note the trailing backslash!
Set oShell = CreateObject("Shell.Application")
oShell.NameSpace(sDrive).Self.Name = "Some description here"


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx
Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> Programming All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB