• I don't know about getting it into a table with power shell and batch files, but here's an approach that would work in SQL. It'll fire the fsutil DOS command for every drive from a: to z:. If you want to fire this for a known list of drives instead, you could probably modify it. This does require that you can use xp_cmdshell and the SELECT statement could use a little tweaking.

    DECLARE @intDrive Integer,

    @strSQL Varchar(100);

    SET @intDrive = 97;

    DECLARE @Drives TABLE (

    Drive Char(1),

    Info Varchar(80));

    WHILE @intDrive <= 122

    BEGIN

    SET @strSQL = 'execute xp_cmdshell ''fsutil volume diskfree ' + CHAR(@intDrive) + ':''';

    INSERT @Drives(Info)

    EXEC (@strSQL);

    UPDATE @Drives

    SET Drive = CHAR(@intDrive)

    WHERE Drive IS NULL;

    SET @intDrive = @intDrive + 1;

    END;

    SELECT Drive, TotalBytes, FreeBytes

    FROM (SELECT Drive,

    SUM(CASE WHEN Info LIKE 'Total # of bytes : %' THEN CAST(REPLACE(SUBSTRING(Info, 32, 48), CHAR(13), '') AS Bigint) ELSE CAST(0 AS Bigint) END) TotalBytes,

    SUM(CASE WHEN Info LIKE 'Total # of free bytes : %' THEN CAST(REPLACE(SUBSTRING(Info, 32, 48), CHAR(13), '') AS Bigint) ELSE CAST(0 AS Bigint) END) FreeBytes,

    SUM(CASE WHEN Info LIKE 'Total # of avail free bytes : %' THEN CAST(REPLACE(SUBSTRING(Info, 32, 48), CHAR(13), '') AS Bigint) ELSE CAST(0 AS Bigint) END) AvailFreeBytes

    FROM (SELECT Drive, Info

    FROM @Drives

    WHERE Info LIKE 'Total # of %') useless_alias

    GROUP BY Drive) useless_alias_2

    ORDER BY Drive;