Disk space Check via SQL Server

Im writing this script since most of them are looking a way to find total diskspace available in a drives through sql server. I hope there is no extended procedure for this. Ive used WMI script to do this, Copy the vbs script and save it to a location as diskspace.vbs and use this location in the sql script to get the result.