获取操作系统属性[WSH][计算机管理]
2004-05-09 11:02
274 查看
获取操作系统属性[WSH][计算机管理][Windows Script Host]
获取有关计算机上所安装的操作系统信息,其中包括语言种类、加密级别和内建编号等。
脚本代码Set dtmConvertedDate = CreateObject("WbemScripting.SWbemDateTime")
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 "Boot Device: " & objOperatingSystem.BootDevice
Wscript.Echo "Build Number: " & objOperatingSystem.BuildNumber
Wscript.Echo "Build Type: " & objOperatingSystem.BuildType
Wscript.Echo "Caption: " & objOperatingSystem.Caption
Wscript.Echo "Code Set: " & objOperatingSystem.CodeSet
Wscript.Echo "Country Code: " & objOperatingSystem.CountryCode
Wscript.Echo "Debug: " & objOperatingSystem.Debug
Wscript.Echo "Encryption Level: " & objOperatingSystem.EncryptionLevel
dtmConvertedDate.Value = objOperatingSystem.InstallDate
dtmInstallDate = dtmConvertedDate.GetVarDate
Wscript.Echo "Install Date: " & dtmInstallDate
Wscript.Echo "Licensed Users: " & _
objOperatingSystem.NumberOfLicensedUsers
Wscript.Echo "Organization: " & objOperatingSystem.Organization
Wscript.Echo "OS Language: " & objOperatingSystem.OSLanguage
Wscript.Echo "OS Product Suite: " & objOperatingSystem.OSProductSuite
Wscript.Echo "OS Type: " & objOperatingSystem.OSType
Wscript.Echo "Primary: " & objOperatingSystem.Primary
Wscript.Echo "Registered User: " & objOperatingSystem.RegisteredUser
Wscript.Echo "Serial Number: " & objOperatingSystem.SerialNumber
Wscript.Echo "Version: " & objOperatingSystem.Version
Next
TechNet 脚本中心:获取操作系统属性
描述信息获取有关计算机上所安装的操作系统信息,其中包括语言种类、加密级别和内建编号等。
脚本代码Set dtmConvertedDate = CreateObject("WbemScripting.SWbemDateTime")
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 "Boot Device: " & objOperatingSystem.BootDevice
Wscript.Echo "Build Number: " & objOperatingSystem.BuildNumber
Wscript.Echo "Build Type: " & objOperatingSystem.BuildType
Wscript.Echo "Caption: " & objOperatingSystem.Caption
Wscript.Echo "Code Set: " & objOperatingSystem.CodeSet
Wscript.Echo "Country Code: " & objOperatingSystem.CountryCode
Wscript.Echo "Debug: " & objOperatingSystem.Debug
Wscript.Echo "Encryption Level: " & objOperatingSystem.EncryptionLevel
dtmConvertedDate.Value = objOperatingSystem.InstallDate
dtmInstallDate = dtmConvertedDate.GetVarDate
Wscript.Echo "Install Date: " & dtmInstallDate
Wscript.Echo "Licensed Users: " & _
objOperatingSystem.NumberOfLicensedUsers
Wscript.Echo "Organization: " & objOperatingSystem.Organization
Wscript.Echo "OS Language: " & objOperatingSystem.OSLanguage
Wscript.Echo "OS Product Suite: " & objOperatingSystem.OSProductSuite
Wscript.Echo "OS Type: " & objOperatingSystem.OSType
Wscript.Echo "Primary: " & objOperatingSystem.Primary
Wscript.Echo "Registered User: " & objOperatingSystem.RegisteredUser
Wscript.Echo "Serial Number: " & objOperatingSystem.SerialNumber
Wscript.Echo "Version: " & objOperatingSystem.Version
Next
相关文章推荐
- 深入理解计算机系统 1.7 操作系统管理硬件
- 计算机操作系统笔记(4)--进程管理之进程同步
- 计算机操作系统信息获取及判断
- 操作系统(计算机管理控制程序)5
- 计算机操作系统——设备管理(6)
- 计算机操作系统——文件管理(3)
- 计算机操作系统-磁盘存储器的管理
- 计算机操作系统存储管理(分段与分页)
- 计算机操作系统笔记(2)--进程管理之进程的基本概念
- 计算机操作系统——进程管理(7)
- 计算机操作系统——存储器管理(3)
- 操作系统(计算机管理控制程序)6
- 计算机操作系统——设备管理(4)
- 计算机操作系统笔记(3)--进程管理之进程控制
- Java获取计算机的IP、名称、操作系统等信息
- 操作系统(计算机管理控制程序)7
- 计算机操作系统——文件管理(2)
- 三种方法快速打开win7计算机管理以便查看管理属性
- JAVA获取计算机的IP、名称、操作系统等信息
- 将属性文件交给spring管理,从spring容器中获取属性文件的值