雑多2 のバックアップ(No.1)


WMIでディスク関連の情報を取得.js Edit

function	GetObjectTextList(sQuery){
	var objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}");
	var colItems = objWMIService.ExecQuery(sQuery);
	var s1 = "";
	
	for(var emu = new Enumerator(colItems); !emu.atEnd(); emu.moveNext())
		s1 += emu.item().GetObjectText_();
	return s1;
}

var sText = "Ctrl + C でクリップボードにコピー\n\n\n\n";

sText += GetObjectTextList("SELECT * FROM Win32_DiskDrive\n\n\n\n");
sText += GetObjectTextList("SELECT * FROM Win32_LogicalDisk\n\n\n\n");
sText += GetObjectTextList("SELECT * FROM Win32_DiskPartition\n\n\n\n");
sText += GetObjectTextList("SELECT * FROM Win32_DiskDrivePhysicalMedia\n\n\n\n");
sText += GetObjectTextList("SELECT * FROM Win32_DiskDriveToDiskPartition\n\n\n\n");
sText += GetObjectTextList("SELECT * FROM Win32_LogicalDiskRootDirectory\n\n\n\n");
sText += GetObjectTextList("SELECT * FROM Win32_LogicalDiskToPartition\n\n\n\n");
sText += GetObjectTextList("SELECT * FROM Win32_IDEController\n\n\n\n");
sText += GetObjectTextList("SELECT * FROM Win32_IDEControllerDevice\n\n\n\n");
sText += GetObjectTextList("SELECT * FROM Win32_SystemPartitions\n\n\n\n");
sText += GetObjectTextList("SELECT * FROM Win32_Volume\n\n\n\n");
sText += GetObjectTextList("SELECT * FROM Win32_PhysicalMedia\n\n\n\n");

WScript.Echo(sText);
 

WMIでパーティションの開始アドレスを取得.js Edit

function	GetObjectTextList(sQuery){
	var objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}");
	var colItems = objWMIService.ExecQuery(sQuery);
	var s1 = "";
	
	for(var emu = new Enumerator(colItems); !emu.atEnd(); emu.moveNext())
		s1 += emu.item().GetObjectText_();
	return s1;
}

var sText = "Ctrl + C でクリップボードにコピー\n\n\n\n";

sText += GetObjectTextList("SELECT * FROM Win32_DiskPartition\n\n\n\n");
sText += GetObjectTextList("SELECT * FROM Win32_LogicalDiskToPartition\n\n\n\n");

WScript.Echo(sText);