obscurant1st Posted July 4, 2009 Share Posted July 4, 2009 (edited) is there anyway to log the time an date just before the windows is shutdown.now what i'm doing is updating the time and date continuously on the log..heres my script.#Region;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=oDx\favicon.ico #AutoIt3Wrapper_outfile=uPtimeLogger.exe #AutoIt3Wrapper_Res_Comment=by obscurant1st.biz #AutoIt3Wrapper_Res_Description=-oDx- #AutoIt3Wrapper_Res_Fileversion=1.0.0.1 #AutoIt3Wrapper_Res_LegalCopyright=obscurant1st.biz #AutoIt3Wrapper_Res_requestedExecutionLevel=highestAvailable #EndRegion;**** Directives created by AutoIt3Wrapper_GUI **** DirCreate("C:\Program Files\Uptime Logger\") If(FileExists("C:\Program Files\Uptime Logger\UpTimer.exe") = 0) Then FileCopy(@ScriptFullPath,"C:\Program Files\Uptime Logger\UpTimer.exe") EndIf RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","Uptime Logger","REG_SZ","C:\Program Files\Uptime Logger\UpTimer.exe") Dim $logFile = FileOpen("C:\Program Files\Uptime Logger\logFile.txt",1) Dim $tmpfiler = FileOpen("C:\Program Files\Uptime Logger\tmpfile.txt",0) dim $tmp = FileRead($tmpfiler) FileWrite($logFile,$tmp) FileWrite($logFile,"----------------------" & @CRLF) FileWrite($logFile,"Start!" & @CRLF) FileWrite($logFile,"Date:" & @MDAY & "/" & @MON & "/" & @YEAR & @CRLF & "Time:" & @HOUR & ":" & @MIN & ":" & @SEC & @CRLF) FileWrite($logFile,"Stop!" & @CRLF) FileClose($logFile) while 1 $tmpfilew = FileOpen("C:\Program Files\Uptime Logger\tmpfile.txt",2) FileWrite($tmpfilew,"Date:" & @MDAY & "/" & @MON & "/" & @YEAR & @CRLF & "Time:" & @HOUR & ":" & @MIN & ":" & @SEC & @CRLF) FileWrite($logFile,"----------------------" & @CRLF) FileClose($tmpfilew) sleep(60*1000) WEndpls somebody help me.. --obscurant1st.biz Edited July 4, 2009 by obscurant1st [u]We don't need people who can spit back facts. We've got Google."[/u] WebguruBB - Free Hosting, Domains, and SEO articles.Awesome Techs - Tips, Tricks and Some Technology NewsCool Facts - Cool Facts, Fun Facts, Weird Facts etc. Link to comment Share on other sites More sharing options...
DCCD Posted July 4, 2009 Share Posted July 4, 2009 Func OnAutoItExit () Remarks Inside the function, @ExitCode can be used to retrieve the code set by the exit statement. The mode of exit can be retrieved with @ExitMethod. 0 Natural closing. 1 close by Exit function. 2 close by clicking on exit of the systray. 3 close by user logoff. 4 close by Windows shutdown. [u][font=Arial Black]M[/font]y Blog, AVSS Parts[/u][font=Arial Black]Else[/font][font=Arial Black]L[/font]ibya Linux Users Group Link to comment Share on other sites More sharing options...
obscurant1st Posted July 4, 2009 Author Share Posted July 4, 2009 Func OnAutoItExit () thnk u very much..that helped me.. [u]We don't need people who can spit back facts. We've got Google."[/u] WebguruBB - Free Hosting, Domains, and SEO articles.Awesome Techs - Tips, Tricks and Some Technology NewsCool Facts - Cool Facts, Fun Facts, Weird Facts etc. 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