关注VBS公众号
随时掌握最新VBS技术

获取操作系统及其版本号的vbs脚本

ID:18 / 打印

获取操作系统及其版本号的vbs脚本


'*by r05e

'*操作系统及其版本号

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 objOperatingSystem.Caption & " " & objOperatingSystem.Version

Next


举例脚本(可直接复制至你的vbs文件)


'*by r05e

'*操作系统及其版本号

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 objOperatingSystem.Caption & " " & objOperatingSystem.Version

Next


上一篇: 定时提醒的vbs脚本
下一篇: 读书的vbs脚本

作者:admin @ ZBLOG   2024-10-27

VBS脚本网 vbs 在线。

vbs.com.cn

对此文章有疑问?请提交在 vbs留言 或通过 vbs工具 查找您的VBS信息。

与本文相关文章