Sign in to follow this  
Followers 0

Restart UDF

15 posts in this topic

Posted (edited)

LAST VERSION - 1.0

07-Mar-10

This is my very simple and small UDF. Allows you to restart the script from any location with full restoration of the original command line parameters. I use this library in several of my programs, and I was not disappointed. I hope this UDF will be useful for many as for me. I will be glad to any feedback and suggestions.

Restart UDF Library v1.0

Previous downloads: 943

Restart.au3

Example

#NoTrayIcon

#Include <Misc.au3>
#Include <Restart.au3>

_Singleton('MyProgram')

If MsgBox(36, 'Restarting...', 'Press OK to restart this script.') = 6 Then
	_ScriptRestart()
EndIf
Edited by Yashied

Share this post


Link to post
Share on other sites



Posted

Nice Yashied. Very smart. Thank for sharing. :mellow:

Share this post


Link to post
Share on other sites

Posted

Very useful for me. thanks.

Share this post


Link to post
Share on other sites

Posted

Yes, Actually very useful.

Share this post


Link to post
Share on other sites

Posted (edited)

Wow! It turns out that it was in demand. Thanks.

:mellow:

Edited by Yashied

Share this post


Link to post
Share on other sites

Posted

Cool,

just what I needed. I set up a tray menu based on modern menu from Holger.

For the menu I wrote a treeview based edit tool, which can handle the menu ini.

After editing the tray menu has to be restarted.

I just thought about it, so that it works for script and exe, as I saw this tool.

Works great and really easy to use - no changes, nothing complicated - only include and use.

If I find the stars button - you get it.

Best regards, Reinhard

Share this post


Link to post
Share on other sites

Posted

Thanks.

Share this post


Link to post
Share on other sites

Posted

what i needed.... thanks :idea:

Share this post


Link to post
Share on other sites

Posted

LAST VERSION - 1.0

07-Mar-10

This is my very simple and small UDF. Allows you to restart the script from any location with full restoration of the original command line parameters. I use this library in several of my programs, and I was not disappointed. I hope this UDF will be useful for many as for me. I will be glad to any feedback and suggestions.

Restart UDF Library v1.0

Restart.au3

Example

#NoTrayIcon

#Include <Misc.au3>
#Include <Restart.au3>

_Singleton('MyProgram')

If MsgBox(36, 'Restarting...', 'Press OK to restart this script.') = 6 Then
	_ScriptRestart()
EndIf

many thanks.it's perfect!

Share this post


Link to post
Share on other sites

Posted

Yashied, that is actually brilliant. Very ingenious.

Share this post


Link to post
Share on other sites

Posted (edited)

is it possible to make scite again the StdOut process for the script

So its possible to use ConsoleWrite

How to make this code write in the console

#NoTrayIcon
#Include <Misc.au3>
#Include <Restart.au3>
_Singleton('MyProgram')
If MsgBox(36, 'Restarting...', 'Press OK to restart this script.') = 6 Then
_ScriptRestart()
ConsoleWrite('-> Restarted..!')
EndIf
Edited by PhoenixXL

Share this post


Link to post
Share on other sites

Posted

Your consolewrite is what is known as unreachable code, it will never get to that point.

You would need to add code, to indicate externally whether the script has been restarted.

And read it upon starting the script.

Of course upon exiting your script normally or via a crash you would need to reset whatever variable

you use, be that a text or ini file, or registry or whatever.

Share this post


Link to post
Share on other sites

Posted

Yeah got it thanks

This works

#NoTrayIcon

#Include <Misc.au3>
#Include <Restart.au3>
_Singleton('MyProgram')
If MsgBox(36, 'Restarting...', 'Press OK to restart this script.') = 6 Then
ConsoleWrite('-> Restarted..!')
_ScriptRestart()
EndIf

Share this post


Link to post
Share on other sites

Posted

Yes, but it is not strictly correct, I mean "'-> Restarting..!'" might be more apt at that point.

I'm not nitpicking, if the script fails to restart etc...

Share this post


Link to post
Share on other sites

Posted

Simple and efficient, very helpful, avoid workarounds for the same purpose!

Thank you!


João Carlos.

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