获取主机名的vbs(cmdlib.wsc)
(编辑:jimmy 日期: 2024/12/23 浏览:3 次 )
复制代码 代码如下:
strComputer = "."
Set objCmdLib = CreateObject("Microsoft.CmdLib")
Set objCmdLib.ScriptingHost = WScript.Application
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
WScript.Echo objCmdLib.getHostName(objWMIService)
strComputer = "."
Set objCmdLib = CreateObject("Microsoft.CmdLib")
Set objCmdLib.ScriptingHost = WScript.Application
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
WScript.Echo objCmdLib.getHostName(objWMIService)
下一篇:VBS.Runauto脚本病毒分析篇