VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



How to Retrive Volume Serial Number of C: Drive.

by Muhammad Idris Muhammad Husain Kagzi (1 Submission)
Category: Windows System Services
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 30th January 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

How to Retrive Volume Serial Number of C: Drive.

API Declarations


'Retreives the drive serial number in a Win32 system.
' This is a great example of how to use the WMI scripting library.
'
' The latest version of the library can be downloaded from Microsoft.
'
' The WMI Scripting type library must be referenced to use this routine.
'
' to add the WMI Scripting type library to the project references
'
' 1.Select References from the Project menu.
'
' 2.In the Available References dialog box, select Microsoft WBEM Scripting
' V1.0 Library or Microsoft WMI Scripting V1.1 Library (whichever appears).
'
' 3.If no suitable option appears in the Available References list, add it by
' using the Browse button in the References dialog box. The Browse button opens
' an Add Reference dialog box that enables you to locate the WbemScripting type
' library. The WbemScripting type library resides in the file Wbemdisp.tlb in
' the Wbem installation directory. on computers with the Windows 98 operating
' system, this type library is located in the WindowsSystemWbem
' directory.
' on computers with the Microsoft® Windows NT®/Windows 2000 operating system,
' this type library is located in the WinntSystem32Wbem directory.
'
' 4.Select the file and click Open. Microsoft WBEM Scripting V1.0 Library or
' Microsoft WMI Scripting V1.1 Library appears on the references list.
' Make sure you select the check the box next to this item in the list.
' Just vote me to let me know on my email [email protected]

Rate How to Retrive Volume Serial Number of C: Drive.



    'Muhammad Idris Muhammad Husain Kagzi on 30th Jan 2002

    Dim WMI
    
    Set WMI = GetObject("WinMgmts::Win32_LogicalDisk='C:'")
    MsgBox (GetObject("WinMgmts::Win32_LogicalDisk='C:'").VolumeSerialNumber)
End Sub

Download this snippet    Add to My Saved Code

How to Retrive Volume Serial Number of C: Drive. Comments

No comments have been posted about How to Retrive Volume Serial Number of C: Drive.. Why not be the first to post a comment about How to Retrive Volume Serial Number of C: Drive..

Post your comment

Subject:
Message:
0/1000 characters