lgvlgv Posted September 8, 2011 Posted September 8, 2011 (edited) I wrote a simple program that runs locally and checks some settings/hardware on local machines and then report the information back to a webserver. now i wantet to add some functionality ex: add a defrag and cleanup tasks to the computer to run every night, but if the local machine has SSD disks i dont want to scheadule a defrag sence that hurts the SSD disks beeing only a "memory" and not a real old fashion disk.... Any one have any idea how to find out if any of the local disk are SSD? I dont think the OS is aware of the SSD disk at all.. PS. found this on the web but havent tryed it yet... ------------- I dunno if SSD's all show up as RAM drives, but here's a rework of some code I use to get drive information. Function SSD Set FSO = Server.CreateObject("Scripting.FileSystemObject") Set Drives = FSO.Drives For Each Disk in Drives If Disk.DriveType = 5 Then 'This disk is a RAM drive 'Do something End if Next End Function ------------- //Regards Lasse Edited September 8, 2011 by lgvlgv
Clark Posted September 9, 2011 Posted September 9, 2011 The DriveGetType function returns "Unknown", "Removable", "Fixed", "Network", "CDROM", "RAMDisk". Not sure if one of these is any use to you. You might be able to edit the underlying library to get what you need.
lgvlgv Posted September 9, 2011 Author Posted September 9, 2011 The DriveGetType function returns "Unknown", "Removable", "Fixed", "Network", "CDROM", "RAMDisk". Not sure if one of these is any use to you. You might be able to edit the underlying library to get what you need.Thx.i will play with it and see how it works, i guess playing with underlying librarys is to advanced for my knowlige but i will give it a try
guinness Posted September 9, 2011 Posted September 9, 2011 (edited) Have you thought about WMI, perhaps Win32_DiskDrive or Win32_LogicalDisk. Search Scriptomatic to easily create WMI code. I would think .InterfaceType would provide the correct information, though I don't have a SSD to test with. Edited September 9, 2011 by guinness UDF List:  _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
lgvlgv Posted September 9, 2011 Author Posted September 9, 2011 I tryed "DriveGetType" om my SSD disk home but it just report "Fixed"
lgvlgv Posted September 9, 2011 Author Posted September 9, 2011 Have you thought about WMI, perhaps Win32_DiskDrive or Win32_LogicalDisk. Search Scriptomatic to easily create WMI code. I would think .InterfaceType would provide the correct information, though I don't have a SSD to test with.Thx i will try this
lgvlgv Posted September 9, 2011 Author Posted September 9, 2011 This is the result i get from: Win32_DiskDrive, Win32_LogicalDisk dident show anything good in this case,,,,There are some names/Caption i could use but then again i need to know all SSD disks in the world :/ ***************Computer: localhostAvailability:BytesPerSector: 512Capabilities: 3CapabilityDescriptions:Caption: OCZ CORE_SSDCompressionMethod:ConfigManagerErrorCode: 0ConfigManagerUserConfig: FalseCreationClassName: Win32_DiskDriveDefaultBlockSize:Description: DiskenhetDeviceID: \\.\PHYSICALDRIVE0ErrorCleared:ErrorDescription:ErrorMethodology:Index: 0InstallDate: // ::InterfaceType: IDELastErrorCode:Manufacturer: (Standarddiskenheter)MaxBlockSize:MaxMediaSize:MediaLoaded: TrueMediaType: Fixed hard disk mediaMinBlockSize:Model: OCZ CORE_SSDName: \\.\PHYSICALDRIVE0NeedsCleaning:NumberOfMediaSupported:Partitions: 1PNPDeviceID: IDE\DISKOCZ_CORE_SSD____________________________02.10104\4B4D313038303034333134413042373020302020PowerManagementCapabilities:PowerManagementSupported:SCSIBus: 0SCSILogicalUnit: 0SCSIPort: 0SCSITargetId: 0SectorsPerTrack: 63Signature: 1265149345Size: 64099607040Status: OKStatusInfo:SystemCreationClassName: Win32_ComputerSystemSystemName: SPELTotalCylinders: 7793TotalHeads: 255TotalSectors: 125194545TotalTracks: 1987215TracksPerCylinder: 255Availability:BytesPerSector: 512Capabilities: 3CapabilityDescriptions:Caption: WDC WD1600JS-60MHB5CompressionMethod:ConfigManagerErrorCode: 0ConfigManagerUserConfig: FalseCreationClassName: Win32_DiskDriveDefaultBlockSize:Description: DiskenhetDeviceID: \\.\PHYSICALDRIVE1ErrorCleared:ErrorDescription:ErrorMethodology:Index: 1InstallDate: // ::InterfaceType: IDELastErrorCode:Manufacturer: (Standarddiskenheter)MaxBlockSize:MaxMediaSize:MediaLoaded: TrueMediaType: Fixed hard disk mediaMinBlockSize:Model: WDC WD1600JS-60MHB5Name: \\.\PHYSICALDRIVE1NeedsCleaning:NumberOfMediaSupported:Partitions: 1PNPDeviceID: IDE\DISKWDC_WD1600JS-60MHB5_____________________10.02E04\5&5C6CFD6&0&0.0.0PowerManagementCapabilities:PowerManagementSupported:SCSIBus: 0SCSILogicalUnit: 0SCSIPort: 1SCSITargetId: 0SectorsPerTrack: 63Signature: -735390678Size: 160039272960Status: OKStatusInfo:SystemCreationClassName: Win32_ComputerSystemSystemName: SPELTotalCylinders: 19457TotalHeads: 255TotalSectors: 312576705TotalTracks: 4961535TracksPerCylinder: 255
lgvlgv Posted September 9, 2011 Author Posted September 9, 2011 i will try with BIOS info as well.. if i find any good scripts
GEOSoft Posted September 9, 2011 Posted September 9, 2011 (edited) The compiled Scriptomatic is in my signature and you will (as guinness pointed out) be looking for Win32_DiskDrive and MediaType in particular. You may also be able to get the info by checking the TotalCylinders, TotalHeads, TotalSectors, and TracksPerCylinder. I can't test it but I think they will all be 0 or blank for an SSD. EDIT:Our posts crossed so it looks as though the answer doesn't lie in Win_32DiskDrive. EDIT 2:You might still be able to use it. looking at either Model or Caption. Check several drives and see it they all return a string with CORE_ or _SSD in one of those fields. Edited September 9, 2011 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
guinness Posted September 9, 2011 Posted September 9, 2011 There is one way >> use the second example & then use StringInStr() to search for SSD on the information contained within PNPDeviceID. It's a quick & dirty example as KaFu put it, but it's the closest thing I can think of. UDF List:  _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
Syed23 Posted September 9, 2011 Posted September 9, 2011 Here is the link to download the compile scriptomatic tool. i got it from from GeoSoft's signature http://dundats.mvps.org/AutoIt/files/AI_Scriptomatic.zip Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]
lgvlgv Posted September 9, 2011 Author Posted September 9, 2011 There is one way >> use the second example & then use StringInStr() to search for SSD on the information contained within PNPDeviceID. It's a quick & dirty example as KaFu put it, but it's the closest thing I can think of.Here is the link to download the compile scriptomatic tool. i got it from from GeoSoft's signature http://dundats.mvps.org/AutoIt/files/AI_Scriptomatic.zip i will go for the quick and dirty now becose i can/have control over my enviroment. just scared if any of my customer comes with a new laptop(with SSD disk that dosent have SSD in the name) and my scripts scheadual a derfrag on hes computer..Thx anyway for the quick respnse on these forums.
GEOSoft Posted September 9, 2011 Posted September 9, 2011 (edited) Here are a couple of things I found on line A quote only valid for win7"If solid-state media is detected, Windows disables defragmentation on that disk. The physical nature of solid-state media is such that defragmentation is not needed and in fact, could decrease overall media lifetime in certain cases." And from Intel we have this. It may well apply to all SSDs or they may also be refering only to Windows 7The setup for using Intel SSD as cache is to use 311 series SSD as the cache disk, installed OS on the RAID HDD (traditional hard disk). Since the SSD will work as a cache, OS will not defrag a cache. I'm also thinking that using USB sticks should enable you to test code for various drives. I also found out that another way is to check the rotational speed of the drive which should return 0x001 but I don't know where to get that info from. Edited September 9, 2011 by GEOSoft lgvlgv 1 George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
lgvlgv Posted September 9, 2011 Author Posted September 9, 2011 Thx for the input, if i find something good i will post the code here.
guinness Posted September 9, 2011 Posted September 9, 2011 Perhaps _WinAPI_GetDriveBusType() in WinAPIEx.au3 by Yashied will help?! UDF List:  _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
guinness Posted September 10, 2011 Posted September 10, 2011 (edited) Try this function. Main idea was from Yashied but I took a different approach. Func _GetDriveBusType($sDrive) Local $aArray[14][2] = [[$DRIVE_BUS_TYPE_UNKNOWN, 'UNKNOWN'], _ [$DRIVE_BUS_TYPE_SCSI, 'SCSI'], _ [$DRIVE_BUS_TYPE_ATAPI, 'ATAPI'], _ [$DRIVE_BUS_TYPE_ATA, 'ATA'], _ [$DRIVE_BUS_TYPE_1394, '1394'], _ [$DRIVE_BUS_TYPE_SSA, 'SSA'], _ [$DRIVE_BUS_TYPE_FIBRE, 'FIBRE'], _ [$DRIVE_BUS_TYPE_USB, 'USB'], _ [$DRIVE_BUS_TYPE_RAID, 'RAID'], _ [$DRIVE_BUS_TYPE_ISCSI, 'ISCSI'], _ [$DRIVE_BUS_TYPE_SAS, 'SAS'], _ [$DRIVE_BUS_TYPE_SATA, 'SATA'], _ [$DRIVE_BUS_TYPE_SD, 'SD'], _ [$DRIVE_BUS_TYPE_MMC, 'MMC']] Return $aArray[_WinAPI_GetDriveBusType($sDrive & ":")][1] EndFunc ;==>_GetDriveBusType Edited September 10, 2011 by guinness UDF List:  _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
Yashied Posted September 10, 2011 Posted September 10, 2011 (edited) SSD - Solid-State Drive rather than Single State Disk.Not exactly a reliable way, but still...expandcollapse popupFunc _DriveIsSSD($sDrive) Local $oService, $oItems, $Disk = '', $Part = '', $Text = '' $oService = ObjGet('winmgmts:\\.\root\cimv2') If Not IsObj($oService) Then Return SetError(1, 0, 0) EndIf $oItems = $oService.ExecQuery('SELECT * FROM Win32_LogicalDiskToPartition') If Not IsObj($oItems) Then Return SetError(2, 0, 0) EndIf For $Property In $oItems If StringInStr($Property.Dependent, '"' & $sDrive & '"') Then $Part = StringTrimLeft($Property.Antecedent, StringInStr($Property.Antecedent, '=')) ExitLoop EndIf Next If Not $Part Then Return SetError(3, 0, 0) EndIf $oItems = $oService.ExecQuery('SELECT * FROM Win32_DiskDriveToDiskPartition') If Not IsObj($oItems) Then Return SetError(2, 0, 0) EndIf For $Property In $oItems If StringInStr($Property.Dependent, $Part) Then $Disk = StringTrimLeft($Property.Antecedent, StringInStr($Property.Antecedent, '=')) ExitLoop EndIf Next If Not $Disk Then Return SetError(3, 0, 0) EndIf $oItems = $oService.ExecQuery('SELECT * FROM Win32_DiskDrive WHERE DeviceID = ' & $Disk) If Not IsObj($oItems) Then Return SetError(2, 0, 0) EndIf For $Property In $oItems $Text = $Property.PnPDeviceID ExitLoop Next If Not $Text Then Return SetError(3, 0, 0) EndIf If StringInStr($Text, 'SSD') Then Return 1 Else Return 0 EndIf EndFunc ;==>_DriveIsSSDI'm just looking for the "SSD" keyword in device ID. IDEDISKINTEL_SSDSA2CW120G3_____________________4PC103025&54771BF&0&0.0.0 Edited September 10, 2011 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
guinness Posted September 10, 2011 Posted September 10, 2011 Thats how I would've done it, also looking at my last post SD is for a SD card not a solid state drive. Whoops! Yashied created the function i was suggesting to do in my previous post UDF List:  _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
lgvlgv Posted September 11, 2011 Author Posted September 11, 2011 (edited) Yashied!First query just returned local host? i modifyed little but dont know if i missed something??, it dosent work with the WHERE statement but works without??Help anyone -----MsgBox(64,"test",_DriveIsSSD("\\.\PHYSICALDRIVE0")) Func _DriveIsSSD($isDrive) Local $oService, $objItem, $Text = '',$Text1='',$Text2="",$i=0,$y=0 $strComputer = "localhost" $oService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") $colItems = $oService.ExecQuery('SELECT * FROM Win32_DiskDrive WHERE DeviceID = "' & $isDrive & '"') For $objItem In $colItems $Text = $objItem.PNPDeviceID & @LF $Text1 = $objItem.Model & @LF $text2 = $objItem.DeviceID & @LF If StringInStr($Text, 'SSD') or StringInStr($Text1, 'SSD') Then Return 1 Else Return 0 EndIf Next EndFunc ;==>_DriveIsSSD Edited September 11, 2011 by lgvlgv
lgvlgv Posted September 11, 2011 Author Posted September 11, 2011 (edited) Try this function. Main idea was from Yashied but I took a different approach. Func _GetDriveBusType($sDrive) Local $aArray[14][2] = [[$DRIVE_BUS_TYPE_UNKNOWN, 'UNKNOWN'], _ [$DRIVE_BUS_TYPE_SCSI, 'SCSI'], _ [$DRIVE_BUS_TYPE_ATAPI, 'ATAPI'], _ [$DRIVE_BUS_TYPE_ATA, 'ATA'], _ [$DRIVE_BUS_TYPE_1394, '1394'], _ [$DRIVE_BUS_TYPE_SSA, 'SSA'], _ [$DRIVE_BUS_TYPE_FIBRE, 'FIBRE'], _ [$DRIVE_BUS_TYPE_USB, 'USB'], _ [$DRIVE_BUS_TYPE_RAID, 'RAID'], _ [$DRIVE_BUS_TYPE_ISCSI, 'ISCSI'], _ [$DRIVE_BUS_TYPE_SAS, 'SAS'], _ [$DRIVE_BUS_TYPE_SATA, 'SATA'], _ [$DRIVE_BUS_TYPE_SD, 'SD'], _ [$DRIVE_BUS_TYPE_MMC, 'MMC']] Return $aArray[_WinAPI_GetDriveBusType($sDrive & ":")][1] EndFunc ;==>_GetDriveBusType Only returns ATA Edited September 11, 2011 by lgvlgv
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now