WMI メモ

  OS



  
Set obj = GetObject _
	("winmgmts:\\.\root\cimv2")
Set objTargets = obj.ExecQuery( _
	"select * from Win32_OperatingSystem" _
	)
For Each objTarget in objTargets
	Wscript.Echo "Caption: " & objTarget.Caption
	Wscript.Echo "Version: " & objTarget.Version
	Wscript.Echo "CSName: " & objTarget.CSName
	Wscript.Echo "CSDVersion: " & objTarget.CSDVersion
	Wscript.Echo "WindowsDirectory: " & objTarget.WindowsDirectory
	Wscript.Echo "SystemDirectory: " & objTarget.SystemDirectory
Next
  



  IP Address と MACAddress



  
Set obj = GetObject _
	("winmgmts:\\.\root\cimv2")
Set objTargets = obj.ExecQuery( _
	"select * from Win32_NetworkAdapterConfiguration " & _
	"where IPEnabled = True" _
	)
For Each objTarget in objTargets
	Wscript.Echo "Caption: " & objTarget.Caption
	Wscript.Echo "MACAddress: " & objTarget.MACAddress
	For Each objAddress in objTarget.IPAddress
		Wscript.Echo "IP Address: " & objAddress
	Next
Next
  



  名前空間一覧

  
Set obj = GetObject _
	("winmgmts:\\.\root")
Set objNameSpaces = obj.InstancesOf("__NAMESPACE")
 
For Each objNameSpace In objNameSpaces
	WScript.Echo objNameSpace.Name
Next
  



  クラスメソッド一覧

  
Set objClass = GetObject _
	("winmgmts:\\.\root\cimv2:Win32_OperatingSystem")
For Each objClassMethod In objClass.Methods_
	WScript.Echo objClassMethod.Name
Next
  



  CPU

  
Set obj = GetObject _
	("winmgmts:\\.\root\cimv2")
Set objTargets = obj.ExecQuery( _
	"select * from Win32_Processor" _
	)
For Each objTarget in objTargets 
	Wscript.Echo "Processor: " & objTarget.Description 
Next 
  



  メモリ

  
Set obj = GetObject _
	("winmgmts:\\.\root\cimv2")
Set objTargets = obj.ExecQuery( _
	"select * from Win32_ComputerSystem" _
	)
For Each objTarget in objTargets 
	Wscript.Echo "System Name: " & objTarget.Name 
	Wscript.Echo "System Manufacturer: " & objTarget.Manufacturer 
	Wscript.Echo "System Model: " & objTarget.Model 
	Wscript.Echo "Total Physical Memory: " & objTarget.TotalPhysicalMemory 
Next 
  



  レジストリのキーを列挙

  
const HKEY_LOCAL_MACHINE = &H80000002
Set obj = GetObject _
	("winmgmts:\\.\root\default:StdRegProv")
strKeyPath = "SYSTEM\CurrentControlSet\Services"
obj.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
For Each subkey In arrSubKeys
	Wscript.Echo subkey
Next
  










  infoboard   管理者用   
このエントリーをはてなブックマークに追加




SQLの窓  天気  IT用語辞典
Yahoo!ニュース  マルチ辞書
PHP マニュアル  Google URL短縮 


フリーフォントWEBサービス
SQLの窓WEBサービス

SQLの窓フリーソフト

素材

一般WEBツールリンク

SQLの窓

フリーソフト

JSライブラリ