Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how i can retrieve a volume label? 1

Status
Not open for further replies.

vlitzer

Programmer
Apr 30, 2002
31
AR
So i can get a string whith the name?
 
#include <windows.h>

...

char Drive[] = &quot;C:\\&quot;; // Must point to root of drive
char Label[MAX_PATH];
DWORD dwDontNeedThis;
if ( !GetVolumeInformation ( Drive,
Label,
sizeof ( Label ),
NULL,
&dwDontNeedThis,
&dwDontNeedThis,
NULL,
0 ))
{ // Something went wrong, call GetLastError ( )
// to find out what
} else
{ // Label contains the volume label
}


Marcel

 
exelent!!! that was what i really need.. thanks a lot!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top