supadodger Posted January 12, 2009 Share Posted January 12, 2009 #include <Date.au3>Local $nowdate = _NowDate();$t = FileGetTime(MyApp.exe", 1);$yyyymd = $t[1] & "/" & $t[2] & "/" & $t[0]if FileExists ("MyApp.exe") Then Call ("CheckDate")Else ShellExecute ("http://www.MyWebsite.com/MyApp") EndIf Func CheckDate()if $nowdate > "02/27/2009" Then ProcessClose ("MyApp.exe") FileDelete ("MyApp.exe") Call ("_SelfDelete")Else Run ("MyApp.exe") ENDIF ENDFunc Func _SelfDelete($iDelay = 0) Local $sCmdFile FileDelete(@TempDir & "\scratch.bat") $sCmdFile = 'ping -n ' & $iDelay & '127.0.0.1 > nul' & @CRLF _ & ':loop' & @CRLF _ & 'del "' & @ScriptFullPath & '"' & @CRLF _ & 'if exist "' & @ScriptFullPath & '" goto loop' & @CRLF _ & 'del ' & @TempDir & '\scratch.bat' FileWrite(@TempDir & "\scratch.bat", $sCmdFile) Run(@TempDir & "\scratch.bat", @TempDir, @SW_HIDE) ShellExecute ("http://www.stealingthemblind.com/MyApp")EndFunc Link to comment Share on other sites More sharing options...
supadodger Posted January 12, 2009 Author Share Posted January 12, 2009 i got it it was the 0 if $nowdate > "02/27/2009" Then should have been if $nowdate > "2/27/2009" Then 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