Sign in to follow this  
Followers 0
nitro322

Age of compiled script

6 posts in this topic

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.

Share this post


Link to post
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)


NEWHeader1.png

Share this post


Link to post
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

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
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).

Share this post


Link to post
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?

Share this post


Link to post
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 *

Share this post


Link to post
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
Sign in to follow this  
Followers 0