import org.codehaus.groovy.scriptom.*;
Scriptom.inApartment
{
locator = new ActiveXObject("WbemScripting.SWbemLocator")
service = locator.ConnectServer()
bcs = service.ExecQuery(
"select * from Win32_BootConfiguration")
for(bc in bcs){
// ブート構成の情報を取得
println("BootDirectory:" + bc.bootDirectory)
println("Caption:" + bc.caption)
println("ConfigurationPath:" + bc.configurationPath)
println("Description:" + bc.description)
println("LastDrive:" + bc.lastDrive)
println("ScratchDirectory:" + bc.scratchDirectory)
println("SettingID:" + bc.settingID)
println("TempDirectory:" + bc.tempDirectory)
}
}
実行結果例
BootDirectory:\WINDOWS
Caption:\Device\Harddisk0\Partition1
ConfigurationPath:\WINDOWS
Description:\Device\Harddisk0\Partition1
LastDrive:G:
ScratchDirectory:C:\WINDOWS\system32\config\systemprofile\Local Settings\Temp
SettingID:VariantNull
TempDirectory:C:\WINDOWS\system32\config\systemprofile\Local Settings\Temp
動作環境
JDK6 Update14, groovy1.6.3
関連情報
http://msdn.microsoft.com/en-us/library/aa394078%28VS.85%29.aspx
0 件のコメント:
コメントを投稿