用下面的VB脚本可以显示windows的系统版本:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("SELECT * FROM Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
Wscript.Echo "Caption: " & objOperatingSystem.Caption
Wscript.Echo "Debug: " & objOperatingSystem.Debug
Wscript.Echo "Version: " & objOperatingSystem.Version
Next
假设上面的文本保存为osver.vbs
执行方式及结果如下:
C:\>cscript osver.vbs
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
Caption: Microsoft Windows XP Professional
Debug: False
Version: 5.1.2600
Debug 为False表明当前的windows版本并不是debug版本的,而是release版本的。
阅读(1245) | 评论(0) | 转发(0) |