Syedi123 said:
Hi,
Is it possible to Find Hard disk information like total size, partitions,
total and free size of each partition from registry (Regedit)?
Thanks in Advance
I don't think that such information is held in the registry but you can
extract it with the script below. Here is what you need to do:
- Copy & paste the script into c:\DiskParms.vbs.
- Click Start / Run / cmd {OK}
- Type this command:
cscript //nologo c:\DiskParms.vbs
aDType = split("Unknown Removable Fixed Network CDROM RAMDisk")
Set oFSO = CreateObject("Scripting.FileSystemObject")
LF = Chr(10)
sLine = "Drive Type State Label F/S Size Free
Serial"
WScript.Echo sLine
WScript.Echo String(Len(sLine)+2, "-")
For Each oDrive In oFSO.Drives
D = oDrive.DriveType
if D > UBound(aDType) then D = 0
sLine = oDrive.Path & " " & aDType(D)
If oDrive.IsReady Then
sLine = Append(sLine, "ready", 18, False)
If oDrive.DriveType = 3 Then
sLine = Append(sLine, Left(oDrive.ShareName, 13), 29, False)
Else
sLine = Append(sLine, Left(oDrive.VolumeName, 13), 29, False)
End If
sLine = Append(sLine, oDrive.FileSystem, 44, False)
sLine = Append(sLine, Int(oDrive.TotalSize/1000000), 51, True)
sLine = Append(sLine, Int(oDrive.FreeSpace/1000000), 59, True)
sLine = Append(sLine, Hex(oDrive.SerialNumber), 67, False)
Else
sLine = Append(sLine, "not ready", 18, False)
End If
WScript.Echo sLine
Next
Function Append(L, S, n, numerical)
if n < Len(L) + 2 then n = 2 Else n = n - Len(L)
If numerical Then
Append = L & Left(Space(60), n + 6 - Len(S)) & S
Else
Append = L & Left(Space(60), n) & S
End If
End Function