Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detect SSD drive
Message
From
26/12/2017 08:12:38
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01656676
Message ID:
01656725
Views:
61
Hi Mike,

Thanks, your code runs perfectly on my end however the 'SSD' mediaType is a property of the MSFT_PhysicalDisk class which is in the Root\Microsoft\Windows\Storage namespace.

And I get an OLE error when accessing this nameSpace (see my reply to Yousfi in MESSAGE #1656720).
strComputer = "."
>objWMIService = GetObject("winmgmts:" + "{impersonationLevel=impersonate}!\\" + strComputer + "\root\cimv2")
>colDisks = objWMIService.ExecQuery("Select * from Win32_LogicalDisk")
>For Each objDisk in colDisks
>    ?"DeviceID: "+ objDisk.DeviceID       
>    DO case
>
>        CASE objDisk.DriveType= 1
>            ? "No root directory. " + "Drive type could not be " + "determined."
>        Case objDisk.DriveType=2
>            ? "DriveType: " +  "Removable drive."
>        Case objDisk.DriveType=3
>           ? "DriveType: "+  "Local hard disk."
>        CASE objDisk.DriveType= 4
>            ? "DriveType: " +  "Network disk."      
>        CASE objDisk.DriveType= 5
>            ? "DriveType: " +  "Compact disk."      
>        CASE objDisk.DriveType= 6
>            ? "DriveType: "+   "RAM disk."   
>        OTHERWISE 
>            ? "Drive type could not be" + " determined."
>    EndCase
>ENDFOR
Thierry Nivelet
FoxinCloud
Give your VFP application a second life, web-based, in YOUR cloud
http://foxincloud.com/
Never explain, never complain (Queen Elizabeth II)
Previous
Reply
Map
View

Click here to load this message in the networking platform