[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
dim objFileSys
dim objFile
i = 1

set objFileSys = wscript.Createobject("Scripting.FileSystemObject")
set objFile = objFileSys.createTextFile("WKS_Info.txt",True)



strComputer ="."

Set oWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colComputerSystemItems = oWMIService.ExecQuery ("SELECT * FROM Win32_ComputerSystem",,48)
Set colComputerSystemProductItems = oWMIService.ExecQuery ("SELECT * FROM Win32_ComputerSystemProduct",,48)
Set colSMBIOSItems = oWMIService.ExecQuery( "Select * from Win32_BIOS where PrimaryBIOS = true", , 48 )
Set colNetworkAdapterItems = oWMIService.ExecQuery("Select * from Win32_NetworkAdapterConfiguration where IPEnabled = 1",,48)
set hostname = hostname

' On Error Resume Next
For Each oComputerSystem In colComputerSystemItems

        objFile.Writeline("Name is: " & oComputerSystem.Name)
        objFile.Writeline("Made by: " & oComputerSystem.Manufacturer)
        objFile.Writeline("Model is: " & oComputerSystem.Model)
        objFile.Writeline()
        
Next

For Each oComputerSystemProduct In colComputerSystemProductItems
        
        objFile.writeline("UUID is: " & oComputerSystemProduct.UUID)
        objFile.Writeline()
Next
        
For Each oSMBIOS In colSMBIOSItems
        
        objFile.Writeline("BIOS version is: " & oSMBIOS.SMBIOSBIOSVersion)
        objFile.Writeline("Serial Number is: " & oSMBIOS.SerialNumber)
        objFile.Writeline()
Next
        objFile.Writeline("hostname is: " & hostname)
   
Next

For Each NetworkAdapter in colNetworkAdapterItems  
                    
           If i < 3 Then
         
        objFile.Writeline("NIC " & i & " name is: " & NetworkAdapter.Description)
        objFile.writeline("MAC address is: " & NetworkAdapter.MACAddress)
        objFile.Writeline()

        i = i + 1
        
        End If

  
Next  

wscript.echo "Workstation info dumping is finished!"
---学无止境---

TOP

返回列表