Label D: Foo works fine because D: is a local drive. If D: were a mapped network drive then this would fail and give the error "the network request was not supported".
 
I am on Windows 2000 Pro, Service Pack 1.
 
 
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;

Reply via email to