是否可以在HTA的IE11 WSShell中从WMIC直接获得输出?



我知道这是一种非常过时的技术,但是我仍然想收集一些关于HTA运行的系统的信息(CPU模型等),并将其显示在同一个窗口中。问题来自IE11,其中GetObject函数不再是一个东西,所以我必须找到一些其他的方法,我尝试了不同的东西负载,但要么我无法检索输出或它根本不会工作/不会包含我想要的信息。所以,目前我没有任何代码,甚至没有远程工作,所以目前有任何方法检索信息,如CPU模型,GPU模型,RAM等与IE11?

下面的代码检索您请求的数据并作为HTA运行。这是一个变化的代码张贴在这里:HTA中的VBS提取sys信息它使用VBScript,所以,它被设置为在IE9模式下运行,但在Windows 10和Windows 11上运行良好。

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="x-ua-compatible" content="ie=9">
</head>
<body>
<textarea id="ta1" cols="80" rows="20">
</textarea>
<script type="text/javascript">
ta1.write = function(txt) {ta1.value += txt + "rn";}
</script>
<script type="text/vbscript">
window.resizeTo 700,400
Set oWMI = GetObject("winmgmts://./root/cimv2")
Set colProcessors = oWMI.ExecQuery("Select * from Win32_Processor")
For Each oItem in colProcessors
ta1.write "Name                : " & oItem.Name
ta1.write "Description         : " & oItem.Description
ta1.write "Processor ID        : " & oItem.ProcessorID
ta1.write "Address Width       : " & oItem.AddressWidth
ta1.write "Data Width          : " & oItem.DataWidth
ta1.write "Family              : " & oItem.Family
ta1.write "Maximum Clock Speed : " & oItem.MaxClockSpeed
Next
Set oItems = oWMI.ExecQuery("Select * from Win32_PhysicalMemory")
For Each oItem in oItems
ta1.write "Total Memory        : " & oItem.Capacity
Next
Set oItems = oWMI.ExecQuery("Select * from Win32_VideoController")
For Each oItem in oItems
ta1.write "Display Adapter     : " & oItem.Description
ta1.write "Driver Version      : " & oItem.DriverVersion
ta1.write "Adapter RAM         : " & Abs(oItem.AdapterRAM)
Next
</script>
</body>
</html>

最新更新