oren 0 Posted May 26, 2011 As the topic say.. Is it possible to know how much time have passed since computer started? , Windows runtime? Thank you Share this post Link to post Share on other sites
hannes08 39 Posted May 26, 2011 Hello oren, there's awindows tool called systeminfo and I'm sure you can gather this data via WMI. Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Share this post Link to post Share on other sites
water 2,393 Posted May 26, 2011 Here is an example how to do it using WMI. It's written in Visual Basic but this should be easy to convert. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
Melba23 3,457 Posted May 26, 2011 oren, This gives the time since boot in ms: $aRet = DllCall("kernel32.dll", "long", "GetTickCount") ConsoleWrite($aRet[0] & @CRLF) M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Share this post Link to post Share on other sites
JoHanatCent 13 Posted May 26, 2011 So that should give us this? $aRet = DllCall("kernel32.dll", "long", "GetTickCount") $aRet[0] = $aRet[0]/1000 $days = Int($aRet[0]/(24*60*60)) $remain=Mod($aRet[0],(24*60*60)) $Hours = Int($remain/(60*60)) $remain=Mod($remain,(60*60)) $Mins = Int($remain/60) $Secs=Mod($remain,60) MsgBox(0, '', 'Days = '&$days&@CRLF& _ 'Hours = '&$Hours&@CRLF& _ 'Minutes = '&$Mins&@CRLF& _ 'Seconds = '&$Secs) Share this post Link to post Share on other sites
UEZ 1,278 Posted May 26, 2011 (edited) Here my version: Br,UEZ Edited May 26, 2011 by 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!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Share this post Link to post Share on other sites
wakillon 403 Posted May 26, 2011 You can use an AutoIt function too... #include <Date.au3> ConsoleWrite ( "Elapsed Time Since Windows Start in Sec : " & Round ( _Date_Time_GetTickCount ( )/1000 ) & @Crlf ) AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Share this post Link to post Share on other sites
Melba23 3,457 Posted May 26, 2011 (edited) wakillon, I had a suspicion there was a function available but I could not find it when I looked - the Help file is too big sometimes! M23 Edit: Look familar? Func _Date_Time_GetTickCount() Local $aResult = DllCall("kernel32.dll", "dword", "GetTickCount") If @error Then Return SetError(@error, @extended, 0) Return $aResult[0] EndFunc ;==>_Date_Time_GetTickCount Edited May 26, 2011 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Share this post Link to post Share on other sites
wakillon 403 Posted May 26, 2011 (edited) I was surprised you did not mention this function ! but it's right that there are many date and time functions... Edited May 26, 2011 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Share this post Link to post Share on other sites
MvGulik 86 Posted May 26, 2011 (edited) nevermind. Edited June 28, 2011 by iEvKI3gv9Wrkd41u "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)"Believing what you know ain't so" ...Knock Knock ... Share this post Link to post Share on other sites