by Karthikeyan (187 Submissions)
Category: Miscellaneous
Compatability: VB Script
Difficulty: Unknown Difficulty
Originally Published: Thu 29th July 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Get the information of your hard disk using Win32_DiskDrive WMI Class
'Generated using 'WMI Win32 Class Autoscript Generator' - Developed by Karthikeyan
'Homepage: http://www.geocities.com/marskarthik
On Error Resume Next
Computer = "."
Set OutFile = CreateObject("WScript.Shell")
Const ForAppending = 2
Set FileSystem = CreateObject("Scripting.FileSystemObject")
Set TextFile = FileSystem.OpenTextFile ("c:\Win32_DiskDrive.txt", ForAppending, True)
TextFile.WriteLine "Script for Win32_DiskDrive Class by Karthikeyan"
TextFile.WriteLine
Set WMIService = GetObject("winmgmts:\\" & Computer & "\root\cimv2")
Set Items = WMIService.ExecQuery("Select * from Win32_DiskDrive",,48)
For Each SubItems in Items
TextFile.WriteLine "********************************************************************"
TextFile.WriteLine "Availability: " & SubItems.Availability
TextFile.WriteLine "BytesPerSector: " & SubItems.BytesPerSector
TextFile.WriteLine "Capabilities: " & SubItems.Capabilities
TextFile.WriteLine "CapabilityDescriptions: " & SubItems.CapabilityDescriptions
TextFile.WriteLine "Caption: " & SubItems.Caption
TextFile.WriteLine "CompressionMethod: " & SubItems.CompressionMethod
TextFile.WriteLine "ConfigManagerErrorCode: " & SubItems.ConfigManagerErrorCode
TextFile.WriteLine "ConfigManagerUserConfig: " & SubItems.ConfigManagerUserConfig
TextFile.WriteLine "CreationClassName: " & SubItems.CreationClassName
TextFile.WriteLine "DefaultBlockSize: " & SubItems.DefaultBlockSize
TextFile.WriteLine "Description: " & SubItems.Description
TextFile.WriteLine "DeviceID: " & SubItems.DeviceID
TextFile.WriteLine "ErrorCleared: " & SubItems.ErrorCleared
TextFile.WriteLine "ErrorDescription: " & SubItems.ErrorDescription
TextFile.WriteLine "ErrorMethodology: " & SubItems.ErrorMethodology
TextFile.WriteLine "Index: " & SubItems.Index
TextFile.WriteLine "InstallDate: " & SubItems.InstallDate
TextFile.WriteLine "InterfaceType: " & SubItems.InterfaceType
TextFile.WriteLine "LastErrorCode: " & SubItems.LastErrorCode
TextFile.WriteLine "Manufacturer: " & SubItems.Manufacturer
TextFile.WriteLine "MaxBlockSize: " & SubItems.MaxBlockSize
TextFile.WriteLine "MaxMediaSize: " & SubItems.MaxMediaSize
TextFile.WriteLine "MediaLoaded: " & SubItems.MediaLoaded
TextFile.WriteLine "MediaType: " & SubItems.MediaType
TextFile.WriteLine "MinBlockSize: " & SubItems.MinBlockSize
TextFile.WriteLine "Model: " & SubItems.Model
TextFile.WriteLine "Name: " & SubItems.Name
TextFile.WriteLine "NeedsCleaning: " & SubItems.NeedsCleaning
TextFile.WriteLine "NumberOfMediaSupported: " & SubItems.NumberOfMediaSupported
TextFile.WriteLine "Partitions: " & SubItems.Partitions
TextFile.WriteLine "PNPDeviceID: " & SubItems.PNPDeviceID
TextFile.WriteLine "PowerManagementCapabilities: " & SubItems.PowerManagementCapabilities
TextFile.WriteLine "PowerManagementSupported: " & SubItems.PowerManagementSupported
TextFile.WriteLine "SCSIBus: " & SubItems.SCSIBus
TextFile.WriteLine "SCSILogicalUnit: " & SubItems.SCSILogicalUnit
TextFile.WriteLine "SCSIPort: " & SubItems.SCSIPort
TextFile.WriteLine "SCSITargetId: " & SubItems.SCSITargetId
TextFile.WriteLine "SectorsPerTrack: " & SubItems.SectorsPerTrack
TextFile.WriteLine "Signature: " & SubItems.Signature
TextFile.WriteLine "Size: " & SubItems.Size
TextFile.WriteLine "Status: " & SubItems.Status
TextFile.WriteLine "StatusInfo: " & SubItems.StatusInfo
TextFile.WriteLine "SystemCreationClassName: " & SubItems.SystemCreationClassName
TextFile.WriteLine "SystemName: " & SubItems.SystemName
TextFile.WriteLine "TotalCylinders: " & SubItems.TotalCylinders
TextFile.WriteLine "TotalHeads: " & SubItems.TotalHeads
TextFile.WriteLine "TotalSectors: " & SubItems.TotalSectors
TextFile.WriteLine "TotalTracks: " & SubItems.TotalTracks
TextFile.WriteLine "TracksPerCylinder: " & SubItems.TracksPerCylinder
TextFile.WriteLine "********************************************************************"
Next
TextFile.Close
OutFile.Run "notepad.exe c:\Win32_DiskDrive.txt",1,True
No comments have been posted about Get the information of your hard disk using Win32_DiskDrive WMI Class. Why not be the first to post a comment about Get the information of your hard disk using Win32_DiskDrive WMI Class.