declare integer GetVolumeInformation in win32api ;
string rootdir, string @volumename, integer vnamesize,;
integer @ volserial, integer a, integer b, string c, integer d
* note the difference - I have the API pass back an integer for volserial directly
CLEAR
buf1 = NULL && if not null, this needs to be drive letter: + chr(0)
* additional init variables needed
volumename = space(254)
vnamesize = 254
*decalre volserial as a numeric
volserial = 0
a = 0
b = 0
c = ""
d = 0
r = GetVolumeInformation(buf1,@volumename,vnamesize,;
@volserial,a,b,c,d)
? "Volserial: "
* note: no CTOBIN needed
? volserial
t = tran(volserial,"@0")
t = strt(t,"0x","")
? t
? ""
* Note - no byte reversal needed
? left(t,4) + '-' + right(t,4)EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater
NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC
The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys