Hi!

I'm noodling around with the WMIQuery UDF script and have modified it to meet my nefarious ends, but there's one last bit I haven't been able to figure out.

I would like to spit out a text file with the drive name, file system, drive size, and free space for each local drive like so:

code:
C:	NTFS	79990847488	74390184960
D: NTFS 79990847488 74390184960
E: NTFS 79990847488 74390184960

I'm guessing you split the info for drive type 3 the same way it's done for dimms and nics in the WMIQuery UDF script:

code:
For Each $dimm in Split(WMIQuery("Capacity","Win32_PhysicalMemory"),"|")
$DimmMem = Val($dimm) / 1048576
WriteLine(6, @wksta + chr(9) + $DimmMem + Chr(13) + Chr(10))
Next

I can't figure that part out, though. The dimm and nic examples only deal with one bit of info ($dimm and $nic), but I need 4 bits per local disk ($drivename, $filesystem, $drivesize, and $freespace).

Plus, the PC I'm testing this all on only has one partition so even if I could figure it out I'd never be sure if it was working.

I'm pulling the info for local disks like so:

code:
	$DriveName = WMIQuery("Name","Win32_LogicalDisk",,"DriveType","3")
$FileSystem = WMIQuery("FileSystem","Win32_LogicalDisk",,"DriveType","3")
$FreeSpace = WMIQuery("FreeSpace","Win32_LogicalDisk",,"DriveType","3")
$DriveSize = WMIQuery("Size","Win32_LogicalDisk",,"DriveType","3")

...but that only gives me info for drive c:

I hope I'm explaining this clear enough...

Many thanks in advance for any help. Truly appreciated.