

Open Visual Studio and choose a C# Windows Forms Project. or we could make use of the System.Management and namespaces. We could write queries ( similar to SQL / LINQ queries ), known as WQL to get this information.

In our programs, there are two methods of using WMI. Writing WMI scripts or apps for remote computer automation of administrative duties, But WMI provides other operating system and product components with management information, too.įor instance, System Center Operations Manager, Microsoft Operations Manager formerly (MOM) or Windows Remote Management (WinRM).Īccording to Layman's terms this means that via the use of WMI, we can retrieve data that is at the heart of our hardware and / or services.

Windows Management Instrumentation (WMI) is the Windows Operating and Data Management (WMI) infrastructure. What is WMI (Windows Management Instrumentation)? Not so many times, Perhaps we need to know what the serial number is on the hard disk especially when we want users to purchase our program licenses. Sometimes we have to understand how much free space there is on our disk, What kind of drive it is and/or what file system is being used. The call to this dll as below: Declare Function GetHDDSerialId Lib "HardDiskInfoV1.dll" () As Stringĭeclare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Longĭim flNumber As Long = LoadLibrary ("HardDiskInfoV1.We are going to discuss how to obtain data from hard disk via WMI. Number easily and efficiently, you can use this serial number to createĪn machine id or encrypt number. So HardDriveInfo.DLL helps us to get the Hard disk serial Serial Number, some time it is necessary to get the hard disk serial HardDriveInfo.DLL does not depend on the "support" You can use HardDriveInfo.DLL to read the real serial number It is an ActiveX COM DLL to read or get hard disk information. Alternatively you can use HardDriveInfo.DLL. MsgBox mydrive.DriveLetter 'displays "C" End SubSee for details.

Set mydrive = fso.GetDrive(path) 'Check for success. Private Sub Command4_Click() Dim fso As New FileSystemObject Dim mydrive As Drive Dim path As String 'Initialize path. Hi, You can use FileSystemObject to get your required info.
