master.dbo.xp_fixeddrives - Add disk drive names?

  • I currently have a job that populates a disk space table by running master.dbo.xp_fixeddrives. This just returns the drive letter, I'm wondering if there's something out there that can also give me the drive name?

    Example: The C:\ drive is called Local Disk and the Q:\ drive is called Quorum.

    How can I get Local Disk and Quorum added to the table as well?

  • You'd need to build a CLR assembly for that.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • You can try the below mentioned code provided you eunderstand enabling xp_cmdshell security effects.

    EXEC master.dbo.xp_cmdshell 'wmic LOGICALDISK LIST BRIEF'

    Manu

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply