I have tride SetVolumeLabel and I have tried using the Label command, but neither of these work, unless I have to specify the drive identifier (Root path name) differently. I have tried the following in Delphi:
 
    SetVolumeLabel(PChar('G:'), PChar('Bob'));
    SetVolumeLabel(PChar('G:\'), PChar('Bob'));
 
    SetVolumeLabel(PChar('\\machinename\C'), PChar('Bob'));
    SetVolumeLabel(PChar('\\machinename\C:'), PChar('Bob'));
 
and for the Label command
 
    Label G: Bob
    Label G:\ Bob
 
    Label \\machinename\C Bob
    Label \\machinename\C: Bob
 
Thanks
 
Stacey
-----Original Message-----
From: Nello Sestini [mailto:[EMAIL PROTECTED]]
Sent: Monday, 5 March 2001 12:07 p.m.
To: Multiple recipients of list delphi
Subject: Re: [DUG]: Renaming/Relabeling A Shared Drive from Delphi.


In Windows Explorer you can rename mapped network drives (right click -> rename, double click -> edit label field).
 
Is it possible to do this from a Delphi App using the windows API?
 
you can call the SetVolumeLabel API function
 
function SetVolumeLabel(lpRootPathName: PChar; lpVolumeName: PAnsiChar): BOOL; stdcall;
{$EXTERNALSYM SetVolumeLabel}
 
 
or you could call WinExec and pass it an appropriate Label command
 
 
-ns

Reply via email to