none
Check if disk is HDD RRS feed

  • Question

  • Hello everyone,

    I am developing a simple c# console app, which get some information about the pc.

    There is any way to check if the main disk (C:\) is an HDD?

    Best regards,

    Leo

    Friday, February 1, 2019 8:01 AM

Answers

All replies

  • You can use WMI :

    MSFT_PhysicalDisk

    with :

    MediaType

    Data type: UInt16

    Access type: Read-only

    The media type of the physical disk.

    Value Meaning
    0
    Unspecified
    3
    HDD
    4
    SSD
    5
    SCM

    Friday, February 1, 2019 8:22 AM
  • Hi,
    You can use "System.IO.Directory.GetLogicalDrives" method for get information of your drives. Please search for this method.
    But (from my experience) I'm afraid you cannot distinguish between HDD and SSD.
    (my sample application [VB.NET])



    Ashidacchi -- https://ssl01.rocketnet.jp/hokusosha.com/default.html

    Friday, February 1, 2019 8:32 AM
  • Thanks for reply Ashidacchi, but for my problem the bast way is the Castorix31's answer

    Best regards

    Friday, February 1, 2019 9:07 AM