Hi @Abdul Samad Patel
This script uses an undocumented SQL Server extended stored procedure named xp_fixeddrives.
The xp_fixeddrives (extended stored procedure) returns a record set that contains the number of megabytes of free space for each physical drive associated with the SQL Server
machine.
To use the results in T-SQL logic, then store the results in a temporary table : #fixdrv.
BTW, The obvious disadvantage with xp_fixeddrives is that it doesn’t return the total size of the disks, only the free space.
As from SQL Server 2008R2 there is a new method to get disk size information by using the function sys.dm_os_volume_stats which also returns information on total space on each drive.
Best regards,
LiHong