Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to rename a mapped drive

0 views
Skip to first unread message

Hartmut Fiebiger

unread,
Feb 20, 2003, 10:09:54 AM2/20/03
to
Hi,
Well I want to write a script that renames the mapped network drive.
Normally the user can do this by manually in the explorer: mark mapped
drive - right mouse
click - label : .... renaming

Does anybody knows a "scriptway" to rename a mapped network drive?
Does someone knows maybe the originall C++ function, to do this, or a com
component?

Thanks in Advance
Hartmut ;-)

name

unread,
Feb 21, 2003, 1:59:24 AM2/21/03
to
Manually
Script
C++
com component

Am I the the [3.] generation genius or you?


"Hartmut Fiebiger" <H.Fie...@HartSoft.de> wrote in message
news:eJM3gHP2...@TK2MSFTNGP09.phx.gbl...

Richard Mueller

unread,
Feb 21, 2003, 1:31:22 PM2/21/03
to
Hartmut Fiebiger wrote:

Hi,

The label I see is in the form

<ShareName> on '<ServerName>'

You can change the name, but then you also have to alter
any code that used the share (to map to it for instance).
I find no "label" attribute. There is a "description"
attribute, but that isn't what I see in Explorer.

To bind to the share:

Set objShare = GetObject
("WinNT://MyDomain/MyServer/lanmanserver/ShareName")
Wscript.Echo "Share name: " & objShare.Name

To rename it, I believe you would have to use the MoveHere
method. I haven't tested it, but the code could be:

Set objLanman = GetObject
("WinNT://MyDomain/MyServer/lanmanserver")
Set objShare = GetObject
("WinNT://MyDomain/MyServer/lanmanserver/ShareName")
Set objNewShare = objLanman.MoveHere
(objShare.AdsPath, "NewShareName")

However, I doubt this is what you want.

Richard

0 new messages