I'd guess this is peculiar to Win 2000. In NT I
can't change the volume
name on mapped drives via the
explorer.
Does this even make sense in general? What if
the drive is mapped to
a network share? Then what label are you
changing?
In any case you might try doing this using the WScript
FileSystemObject interface.
It doesn't work for me in NT - I get a permissions error
when
I try to rename a mapped drive - but it might work in your
environment.
I admit it's ugly - but it might work.
here's the code I (tried to) use:
uses comobj;
{$R *.DFM}
procedure
TForm1.RenameVol(drvname,newvolname:string);
var fso: Variant; drv: Variant; begin fso := CreateOleObject('scripting.filesystemobject'); drv := fso.GetDrive(drvname); drv.volumename:=newvolname; end; |
- [DUG]: Renaming/Relabeling A Shared Drive from Delphi. Stacey Verner
- Re: [DUG]: Renaming/Relabeling A Shared Drive from Del... Nello Sestini
- RE: [DUG]: Renaming/Relabeling A Shared Drive from Del... Stacey Verner
- Re: [DUG]: Renaming/Relabeling A Shared Drive from... Nello Sestini
- RE: [DUG]: Renaming/Relabeling A Shared Drive from Del... Stacey Verner
- Re: [DUG]: Renaming/Relabeling A Shared Drive from... Nello Sestini
- RE: [DUG]: Renaming/Relabeling A Shared Drive from... Nello Sestini
- RE: [DUG]: Renaming/Relabeling A Shared Drive from Del... Stacey Verner