Using xp_disklist

The XP.DLL extended stored procedure xp_disklist returns data obtained from the external environment as a results set. Specifically, it returns a two-column results set listing all the local and network-attached drives (excluding floppy-disk drives) that are available to the computer on which SQL Server is installed. It also lists the space available on each drive. For example:

execute xp_disklist

The caller of this procedure receives disk space information about server disk drives as a two-column SQL Server results set.