Jump to content

Age of compiled script


nitro322
 Share

Recommended Posts

How can I determine the age of a compiled script? I want to, for example, display a message prompting users to download the newest version of it's more than one month old.

I posted a while back asking about compile-time variables (http://www.autoitscript.com/forum/index.php?showtopic=11569), which could be used for this purpose as well, but that doesn't appear to be supported.

Are there any other suggestions for this? Thanks.

Link to comment
Share on other sites

How can I determine the age of a compiled script?  I want to, for example, display a message prompting users to download the newest version of it's more than one month old.

I posted a while back asking about compile-time variables (http://www.autoitscript.com/forum/index.php?showtopic=11569), which could be used for this purpose as well, but that doesn't appear to be supported.

Are there any other suggestions for this?  Thanks.

<{POST_SNAPBACK}>

there's always the obvious choice of hardcoding in a 'birthdate' to the script...

Global $birthday = 9
Global $birthmonth = 9
Global $birthyear=2005
Func ExpirationCheck()
;check if current date is more than 30 days after the birthdate using macros
;and react if it is, or continue if it's not
EndFunc
Link to comment
Share on other sites

with this

$t =  FileGetTime(@Windowsdir & "\Notepad.exe", 1)

If Not @error Then
    $yyyymd = $t[0] & "/" & $t[1] & "/" & $t[2]
    MsgBox(0, "Creation date of notepad.exe", $yyyymd)
EndIf

check help for more info

8)

<{POST_SNAPBACK}>

Heh, I never thought of that.

Alternatively, you could use FileGetTime(@ScriptFullPath).

Link to comment
Share on other sites

I thought about using FileGetTime(), but I'm not sure of it's reliability.  What if the file gets copied?  What if it's renamed?  Will the modified date guaranteed to remain constant?

FileGetTime() on the executable is no good idea. Use the method described by cameronsdad in post #3.

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...