분류 > vbs
Function GetOSVersion()
Dim objWMI, objItem, colItems
Dim VerOS, VerBig, Ver9x, Version9x, OS, OSystem
Set objWMI = GetObject("winmgmts:\\.\root\cimv2")
Set colItems = objWMI.ExecQuery("Select * from Win32_OperatingSystem", , 48)
For Each objItem in colItems
VerBig = Left(objItem.Version,3)
Next
Select Case VerBig
Case "6.1" GetOSVersion = "Win7"
Case "6.0" GetOSVersion = "Vista"
Case "5.2" GetOSVersion = "XP"
Case "5.1" GetOSVersion = "XP"
Case "5.0" GetOSVersion = "W2K"
Case "4.0" GetOSVersion = "NT 4.0**"
Case Else GetOSVersion = "Unknown - probably Win 9x"
End Select
End Function
댓글 없음:
댓글 쓰기