ripdad Posted May 8, 2012 Share Posted May 8, 2012 (edited) Description <grin>After diving into S.M.A.R.T from a previous thread... hmm, might as well take a stab at it.One thing I did find after testing - The Drive Temperature is fairly accurate!Then all I had to find out was how to calculate POH.And, it dawned on me that it turns over every 1000... or is it 200, hmm. (It's 256)Anyway it starts back at 1 and adds the total to another column.So, I figured out (if my math was correct) that my hard drive's life is about half over. (sob)There are about 20 known programs out there in cyberspace. I tested about half of them.Almost none of those would show what I really wanted to know.1. How many hours was on the HD.2. What is the HD life expectancy.Well, I found out both those answers after I made this script.Let me know if any problems. I'll see what I can do about it.Download Version 1.01_WMI_GetATAPISmartData_v1.01.au3Updated: November 26, 20121) changed some logic.2) added more error handling.3) added two additional ways to detect SSD's. Edited November 26, 2012 by ripdad jguinch, UEZ and Emiel Wieldraaijer 3 "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
ricky Posted May 8, 2012 Share Posted May 8, 2012 Hello, thanks a lot, will you integrate it on your sysinfolog script? Regards Link to comment Share on other sites More sharing options...
UEZ Posted May 8, 2012 Share Posted May 8, 2012 Cool, nice to have function! Thanks for sharing it! Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Chimaera Posted May 8, 2012 Share Posted May 8, 2012 Thx for sharing m8One issueIt doesn't read SSD drives very well i have a relatively new couple of month old ish Vertex 2 driveAs you can see it gives a lot of exceeded lifetime so im guseeing because the drive has no hardware it doesnt read it rightUnless my drive is fooked.... If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
ripdad Posted May 8, 2012 Author Share Posted May 8, 2012 Thanks all ricky03 - I need to spend some more time doing research on various vendor drives. But, if I do add it in SysInfoLog, it will just be raw data. I could make it write a table, I suppose. We'll see. Chimaera - I'm surprised that SSD's are supported! It appears the columns are in order, but missing some attribute names. Some are New Attributes, although there are blocks that are reserved for Future Ones. I'll check into this some more. I hadn't even thought that this would be an issue, since no moving parts! The only thing that triggers "Exceeded_Lifetime" is a zero in those columns. Which is kinda strange; it shouldn't be that way. It might be a different version of SMART it uses. "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
ripdad Posted May 9, 2012 Author Share Posted May 9, 2012 Chimaera - Try it now and see if thats any better.Anybody else have anomalies to report? Please do.Updated 1st Post "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
Chimaera Posted May 9, 2012 Share Posted May 9, 2012 Yep thats better it has values now Thx for having a look If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
guinness Posted May 9, 2012 Share Posted May 9, 2012 Great function ripdad, thanks for sharing. 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 Link to comment Share on other sites More sharing options...
ptrex Posted May 9, 2012 Share Posted May 9, 2012 @ripdad good job this one runs on my machine, the first version didn't. Rgds ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
ripdad Posted May 9, 2012 Author Share Posted May 9, 2012 Thanks all - I'm still working on it. Hopefully I can get other problems solved.ptrex - I think I know what cause the 1st script to fail for you. I Assumed that an Attribute would be present in the first set of the array. I changed an IF Statement from ExitLoop to ContinueLoop, but not for your particular instance. Looks like That fixed more than one problem!Also, I ran this on the Win7 64Bit Machine earlier And I found out that #RequireAdmin was needed to make it work on that one. You could always use "Run As Administrator" also.---Thought I would share this from testing that I did on an older drive. It should give you some idea of how to interpret the data.Remember, that just because the data is This Way for This Drive, doesn't mean that the next drive will be the same way.But... I think for this Attribute (9=POH), it's pretty much a standard (as are a few others, ie: Temperature).This is how a Western Digital 80GB Drive would appear if it was somewhat new.(Columns 3 and 4 have the same exact data on This Drive)Starting at column 3 on the array...100|100|96|0|0|0|0|0|0|PowerOnHours(POH) | | | | | | | Total Cycles -or- Turnovers | | Hours Count (this cycle) The Percentage from 100 remaining on the drive Now, some years go by and this is the result... 43|43|142|163|0|0|0|0|0|PowerOnHours(POH) | | | | | | | Total Cycles -or- Turnovers | | Hours Count (this cycle) The Percentage from 100 remaining on the driveOne could easily make a script like this, to reflect the Lifetime Remaining on a hard drive...Local $Value = 43 GUICreate('HardDrive - Lifetime Remaining from POH', 350, 100, -1, -1) GUICtrlCreateLabel($Value & '%', 36, 37, 20, 20) Local $pb = GUICtrlCreateProgress(65, 35, 200, 20) GUICtrlSetData($pb, $Value) GUISetState() Do Until GUIGetMsg() = -3 GUIDelete()Of course, you would get the $Value from the array at column 3 or 4 at Attribute 9.ie: Local $Value = $aSMART[9][4]So, If I'm reading this properly, then on this drive, the overall data in those columns would be like this: 0 = Old Age (lifetime reached) - "43" would eventually fall to zero, right? 1 = Error Flag - this would be the alert.100 = Start Percentage Value - eventually falling over time.200 = OK or N/A (not applicable) or Other - is the way it appears to me. Correct me, if I'm wrong.The rest would be in threshold or data columns.It seems that Cycles or Turnovers are at the end of 255 which carries over to the "Cycles" column as one cycle and Then starts over. I'll have to confirm all this as time goes by.Good day all. "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
ripdad Posted May 10, 2012 Author Share Posted May 10, 2012 Okay, I pretty much confirmed the previous post which I used 2 DOS tools to determine that. You can't get much better than off-line data results. It has tons more info than in Windows. The calculation for POH in the previous post is: Cycles * 256 + CurrentCycle = n PowerOnHours ie: (163 * 256) + 142 = 41870 PowerOnHours --- Heres another one... I'm only covering just a few of these, so you get the idea of what your looking at. Some drives have Extra Data, like this one for Attribute: 194 (Temperature). (temperature values are Celsius in VSData columns) 194|34|0|100|100|33C/91F|0|14|0|53|0|0|Temperature | | | | | | | | | | | | | | | | | Highest Ever Temperature Recorded | (VS%) | | | | Lowest Ever Temperature Recorded | | | Current Temperature | Threshold Heres another one that doesn't have extra data. About the most you can get out of this, is just the current temp... 194|34|0|102|85|41C/106F|0|0|0|0|0|0|Temperature | | | | | | | | | | | | | (VS%) | | | | | | Current Temperature | Threshold --- I also found the problem (or one of the problems) with WMI passing up additional or secondary drives. Condition: The CD-ROM is Master and the Hard Drive is Slave on the secondary IDE channel. The Fix: Swap them. (don't forget to pin them, master or slave) "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
ripdad Posted May 11, 2012 Author Share Posted May 11, 2012 Updated 1st Post I think I'm done with this project - let me know if you experience any problems. "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
Emiel Wieldraaijer Posted May 11, 2012 Share Posted May 11, 2012 @Ripdad Thnx Best regards,Emiel Wieldraaijer Link to comment Share on other sites More sharing options...
ripdad Posted May 11, 2012 Author Share Posted May 11, 2012 (edited) Emiel - you're welcome.I found an oversight that needs to be corrected. That's what happens when you're on Information-Overload.I suppose before I post the update, that I should ask if there is any particular order they want the columns.They are now in the order as the information is obtained.Any suggestions?I could also add a function to auto-configure the columns to a string like this:0|14|2|12|4|5......--EDIT--okay, Added Column Swap.@ricky03 - I haven't forgotten about your request. Give me about a week or so.Updated 1st Post Edited May 12, 2012 by ripdad "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
ricky Posted May 12, 2012 Share Posted May 12, 2012 No problem, you aren't my own coder... You have time... Link to comment Share on other sites More sharing options...
KaFu Posted May 12, 2012 Share Posted May 12, 2012 (edited) UAC is a strange thing indeed... You can run the script locally (only) without admin privileges when you replace the WMI calls like this: Local $objWMI = ObjGet("winmgmts:rootCIMV2") $objWMI = ObjGet("winmgmts:rootWMI") Edit: And really nice script by the way ! Edited May 12, 2012 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
ripdad Posted May 13, 2012 Author Share Posted May 13, 2012 KaFu,Well now, that is strange.I just ran an ACL tool that "Requires Security", with the above call to WMI and it worked as though I had full privileges.I'd say that is some kind of bug in WMI, Or is it?Thanks for the reply. "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
KaFu Posted May 13, 2012 Share Posted May 13, 2012 When I ran the script without admin privileges directly after a fresh restart, I received the error 80041003 (access denied). Then I ran it with admin privileges and it worked fine. Then I ran it again without admin privileges and it work fine again this time too... Seems like the first call with admin privileges pulls something into a kind of cache that can be accessed without the privileges later on, so better stick to require admin access for this script. OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
ripdad Posted May 13, 2012 Author Share Posted May 13, 2012 Yes, that makes sense. And that's pretty much how it works. Once you've obtained the privileges for the current session, it should last until you restart the PC. And you're right, there's no point in trying to 2nd guess it. Might as well leave it "as is", to be on the safe side. Thanks for the input! "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
ricky Posted June 25, 2012 Share Posted June 25, 2012 (edited) Hello,I use a raid system, and with this raid I have the error below :It's possible to manage better the errors? Or have an information more explicit? Of course, I see this problem with the sysinfolog, but the scrypt is the same!Here are the informations from the sysinfolog :<--Win32_DiskDrive(1)BytesPerSector|512 BytesCapabilities|3, 4|3=(Random Access)|4=(Supports Writing)Caption|ER-M2S easyRAIDConfigManagerErrorCode|0=(This device is working properly.)ConfigManagerUserConfig|FalseDescription|Disk driveDeviceID|.PHYSICALDRIVE0Index|0InterfaceType|IDEManufacturer|(Standard disk drives)MediaLoaded|TrueMediaType|Fixed - hard disk mediaModel|ER-M2S easyRAIDName|.PHYSICALDRIVE0Partitions|3PNPDeviceID|IDEDISKER-M2S_EASYRAID_________________________110121.15&3B906009&0&0.0.0FirmwareRevision|110121.1SCSIBus|0SCSILogicalUnit|0SCSIPort|1SCSITargetId|0SectorsPerTrack|63Signature|-254218024Size|931.51 GBStatus|OKTotalCylinders|121601TotalHeads|255TotalSectors|1953520065TotalTracks|31008255TracksPerCylinder|255Of course, I can made a StringInStr in PNPDeviceID with the name "EASYRAID", but by request is to don't crash the soft with a raid system... Edited June 25, 2012 by ricky03 Link to comment Share on other sites More sharing options...
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