Created
January 3, 2021 03:56
-
-
Save fareedfauzi/2ab348a12caebcf47ec37e507d1fbb60 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Blogpost: notes.netbytesec.com | |
Private Sub Document_Open() | |
Dim i As Integer | |
Dim str As String | |
i = 0 | |
Set WMI = GetObject("WinMgmts:") | |
For Each obj In WMI.InstancesOf("Win32_PhysicalMedia") | |
If obj.SerialNumber <> "" Then i = i + 1 | |
Next | |
If i = 0 Then | |
Exit Sub | |
End If | |
st | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment