AutoHotkey should have SSD detection for DriveGet, OutputVar, Type, Path. Probably best to add a few other types too, on the detection list.
Can be important for automation scripts.
DriveGet Detect SSD And Other Types
Re: DriveGet Detect SSD And Other Types
DriveGet, Type is calling GetDriveType function. And there is no return for SSD.
If you want detect SSD you need WMI (MSFT_PhysicalDisk class)
If you want detect SSD you need WMI (MSFT_PhysicalDisk class)
Code: Select all
MSFT_PhysicalDisk()
{
static DiskType := []
static MediaType := { 0: "Unspecified", 3: "HDD", 4: "SDD", 5: "SCM" }
try {
for objItem in ComObjGet("winmgmts:\root\Microsoft\Windows\Storage").ExecQuery("SELECT * FROM MSFT_PhysicalDisk") {
DiskType[A_Index, "FriendlyName"] := objItem.FriendlyName
DiskType[A_Index, "MediaType"] := MediaType[objItem.MediaType]
}
return DiskType
}
return ""
}
for k, v in MSFT_PhysicalDisk()
MsgBox % v.MediaType "`n" v.FriendlyName
Minimum supported client: Windows 8
Minimum supported server: Windows Server 2012
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
Re: DriveGet Detect SSD And Other Types
- @jNizM: This thread originates from this post:
Script to detect if disk is SSD or HDD - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=60878
- AutoIt's DriveGetType has functionality to check if a drive is an SDD. It checks the following criteria (and possibly more):
•Disks whose driver reports “no seek penalty”.
•Disks that report a nominal media rotation rate of 1.
- So far I've written code to check the first criterion (in the link).
- Nice to see you around. Cheers.
Script to detect if disk is SSD or HDD - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=60878
- AutoIt's DriveGetType has functionality to check if a drive is an SDD. It checks the following criteria (and possibly more):
•Disks whose driver reports “no seek penalty”.
•Disks that report a nominal media rotation rate of 1.
- So far I've written code to check the first criterion (in the link).
- Nice to see you around. Cheers.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: DriveGet Detect SSD And Other Types
DriveGetType in AutoIt already has this ability, sad for AutoHotkey not to.
Looks easy to implement.
Better for automation scripts to be able to identify drive or media to operate on.
Looks easy to implement.
Better for automation scripts to be able to identify drive or media to operate on.
Re: DriveGet Detect SSD And Other Types
Yeah but it is using a bad implementation. jNizM provided working code for a new impementation.
If someone wants to add this feature please use jNizMs concept.
If someone wants to add this feature please use jNizMs concept.
Recommends AHK Studio
Re: DriveGet Detect SSD And Other Types
- The original thread warned against these 2 approaches:
•There's a way to do it in Windows Powershell - but it only works in Win 8 and up.
•Some people suggest using WMIC to get the model of the disk and see if it has "SSD" in the model number but since not all SSDs have "SSD" in the model, that's not a great solution.
- Is jNizM's approach, one of those 2 approaches?
•There's a way to do it in Windows Powershell - but it only works in Win 8 and up.
•Some people suggest using WMIC to get the model of the disk and see if it has "SSD" in the model number but since not all SSDs have "SSD" in the model, that's not a great solution.
- Is jNizM's approach, one of those 2 approaches?
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: DriveGet Detect SSD And Other Types
Well if there is no way to do it without using side channels such as
If someone finds a reliable direct APi that explicitly states, which drives are SSD and which aren't we can add this.
Anything else just doesn't do the job.
or•Disks whose driver reports “no seek penalty”.
•Disks that report a nominal media rotation rate of 1.
qnd no way to do it for all windows versions, then there simply is no way we can offer a built in command for this.•Some people suggest using WMIC to get the model of the disk and see if it has "SSD" in the model number but since not all SSDs have "SSD" in the model, that's not a great solution.
If someone finds a reliable direct APi that explicitly states, which drives are SSD and which aren't we can add this.
Anything else just doesn't do the job.
Recommends AHK Studio
Who is online
Users browsing this forum: No registered users and 56 guests