| WScript.Echo WMIGetSystemDirectory( )
' **********************************************************
' システムディレクトリの取得
' **********************************************************
Function WMIGetSystemDirectory( )
Dim strComputer,objWMIService,colOSes,objOS
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colOSes = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
For Each objOS in colOSes
WMIGetSystemDirectory = objOS.SystemDirectory
Next
End Function
| |