Armand Posted July 31, 2007 Share Posted July 31, 2007 (edited) by far i'm using a somewhat stupid mathode: - i'm making the script create a "RestartMyAPP.bat" File with the commands to wait 5 secs and start my app again. - then i've added it to start without waiting in the ONEXIT func any normal way to make it ?! If $RestartAPP = 1 Then $file = FileOpen(@TempDir & "\RestartMyAPP.bat", 1) FileWriteLine($file, "ping -n 5 127.0.0.1 >nul") FileWriteLine($file, @ScriptFullPath) FileClose($file) ShellExecute("RestartMyAPP.bat", "", @TempDir, "open", @SW_HIDE) EndIf Edited July 31, 2007 by Armand [u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?! Link to comment Share on other sites More sharing options...
Xenobiologist Posted July 31, 2007 Share Posted July 31, 2007 Hi, If Not $CMDLINE[0] Then If UBound(ProcessList(@ScriptName)) > 2 Then Exit ElseIf $CMDLINE[1] <> '/restart' Then Exit EndIf ;... ;... ;... While 1 Switch GUIGetMsg() Case $buttonGO Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptFullPath & '" /restart') Exit EndSwitch WEnd So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Dagorath Posted July 31, 2007 Share Posted July 31, 2007 by far i'm using a somewhat stupid mathode:- i'm making the script create a "RestartMyAPP.bat" File with the commands to wait 5 secs and start my app again.- then i've added it to start without waiting in the ONEXIT funcany normal way to make it ?!It sounds like you are starting a second instance of your script in the ONEXIT function. Then the first instance exits. If you know you need to have the script running then why allow the first instance to exit? Why not just reinitialise all the conditions and variables and start it over from the top? It sounds like you need to put your code inside a never ending loop. Have I missed something? Link to comment Share on other sites More sharing options...
Armand Posted July 31, 2007 Author Share Posted July 31, 2007 (edited) Well... I want my script to check for updates if there are some then it shoul'd download them and replace the running compiled script with the ones downloaded - so far so good ! but then, as the script finishes the download it seems like it's continuing with the NEW SCRIPT from the same place it stoped in the OLD SCRIPT, so maybe i do need to just send it to the start... but how do i do that ?! (should i insert the entire script into a func and then just call it ?!) @Xenobiologist what does your script do man ?! Edited July 31, 2007 by Armand [u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?! Link to comment Share on other sites More sharing options...
Armand Posted July 31, 2007 Author Share Posted July 31, 2007 Maybe this will help : If $RestartAPP = 1 Then $file = FileOpen(@TempDir & "\RestartMyAPP.bat", 1) FileWriteLine($file, "ping -n 5 127.0.0.1 >nul") FileWriteLine($file, @ScriptFullPath) FileClose($file) ShellExecute("RestartMyAPP.bat", "", @TempDir, "open", @SW_HIDE) EndIf [u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?! Link to comment Share on other sites More sharing options...
Developers Jos Posted July 31, 2007 Developers Share Posted July 31, 2007 Run(@ScriptFullPath) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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