LOCAL oService, oClasses
STRTOFILE(0h0D0A+"** 物理磁盘驱动器 ******", "test.txt")
oService = GETOBJECT("winmgmts:")
oClasses = oService.InstancesOf("Win32_DiskDrive")
FOR EACH oClass IN oClasses
STRTOFILE(0h0D0A0D0A+"#" + TRANSFORM(NVL(oClass.index, "<NULL>")) + " 驱动器 - " + NVL(oClass.Description, "<NULL>") + 0h0D0A +;
"接口类型.." + NVL(oClass.InterfaceType, "<NULL>") + 0h0D0A +;
"型号......" + NVL(oClass.Model, "<NULL>") + 0h0D0A +;
"序列号...." + ALLTRIM(NVL(oClass.SerialNumber, "<NULL>")) + 0h0D0A +;
"固件号...." + NVL(oClass.FirmwareRevision, "<NULL>") + 0h0D0A +;
"容量......" + LTRIM(TRANSFORM(VAL(NVL(oClass.Size, "<NULL>")), "999,999,999,999,999")) + " Byte", "test.txt", 1)
ENDFOR
STRTOFILE(0h0D0A0D0A+"** 逻辑磁盘驱动器 ******", "test.txt", 1)
oClasses = oService.InstancesOf("Win32_LogicalDisk")
FOR EACH oClass IN oClasses
STRTOFILE(0h0D0A0D0A+"盘符........" + NVL(oClass.DeviceID, "<NULL>") + 0h0D0A +;
"类型........" + NVL(oClass.Description, "<NULL>") + 0h0D0A +;
"文件系统...." + NVL(oClass.FileSystem, "<NULL>") + 0h0D0A +;
"空间大小...." + LTRIM(TRANSFORM(VAL(NVL(oClass.Size, "<NULL>")), "999,999,999,999,999")) + " Byte" + 0h0D0A +;
"可用空间...." + LTRIM(TRANSFORM(VAL(NVL(oClass.FreeSpace, "<NULL>")), "999,999,999,999,999")) + " Byte" + 0h0D0A +;
"卷标........" + NVL(oClass.VolumeName, "<NULL>") + 0h0D0A +;
"卷标序列号.." + NVL(oClass.VolumeSerialNumber, "<NULL>"), "test.txt", 1)
ENDFOR
MODIFY FILE test.txt