I know I can get the volume serial number of a disk by doing a
system("vol > file.txt") and the reading out of the textfile and picking
it out.
I would like to know is there an elegant way to get this info using
Vbscript or WSH?
TIA
Leopoldo
dim objFS
dim objDrive
dim numSerial
set objFS = Server.CreateObject("Scripting.FileSystemObject")
set objDrive = objFS.GetDrive(\\machine\sharename)
numSerial = objDrive.SerialNumber
Regards,
Bret Hern
bh...@spamcop.net
"Leopoldo Colmenares" <lco...@cantv.net> wrote in message
news:6085a503.01092...@posting.google.com...
Regards,
>.
>
Thanks Bret, but I want to get the *volume serial number*, not
the computer serial number.
For example in my computer the serial number is: -1942617574 ( I don't
understand why the minus sign), and the C hard drive volume serial number
is 8C35-214C. You can get it in MS-DOS with the vol command.
Thanks again,
If you want it with a - in the middle...
hexSerial = Hex(objDrive.SerialNumber)
hexSerialDisplay = left(hexSerial,4) & "-" & right(hexSerial,4)
--
Michael Harris
Microsoft.MVP.Scripting
--
mik...@mvps.org
Please do not email questions - post them to the newsgroup instead.
--
Leopoldo
"Michael Harris \(MVP\)" <mik...@mvps.org> wrote in message news:<OdUIiZtQBHA.1440@tkmsftngp04>...