Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Restart UDF


  • Please log in to reply
14 replies to this topic

#1 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 07 March 2010 - 08:22 PM

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

Attached File  Restart.au3   2.56KB   1788 downloads


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, 10 December 2013 - 04:31 PM.








#2 Beege

Beege

    Universalist

  • MVPs
  • 895 posts

Posted 08 March 2010 - 03:40 AM

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

#3 gooker

gooker

    Wayfarer

  • Active Members
  • Pip
  • 50 posts

Posted 08 March 2010 - 10:31 AM

Very useful for me. thanks.
Posted Image

#4 Shafayat

Shafayat

    Polymath

  • Active Members
  • PipPipPipPip
  • 245 posts

Posted 08 March 2010 - 10:54 AM

Yes, Actually very useful.
[Not using this account any more. Using "iShafayet" instead]

#5 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 08 March 2010 - 07:11 PM

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

:mellow:

Edited by Yashied, 08 March 2010 - 07:11 PM.


#6 ReFran

ReFran

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 554 posts

Posted 12 March 2010 - 08:39 PM

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

#7 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 12 March 2010 - 11:33 PM

Thanks.

#8 semedboy

semedboy

    Seeker

  • Active Members
  • 22 posts

Posted 22 May 2010 - 09:47 PM

what i needed.... thanks :idea:
0x5748415420444F20594F552057414E543F

#9 chong

chong

    Seeker

  • Active Members
  • 8 posts

Posted 24 May 2010 - 06:15 AM

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

Attached File  Restart.au3   2.56KB   1788 downloads


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!
Try to face everything troubles you.nothing is impossible!

#10 James

James

    Universalist

  • MVPs
  • 10,263 posts

Posted 24 May 2010 - 03:45 PM

Yashied, that is actually brilliant. Very ingenious.

#11 PhoenixXL

PhoenixXL

    be what you are, its always the BEST..

  • MVPs
  • 1,561 posts

Posted 18 July 2012 - 03:57 PM

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, 18 July 2012 - 03:58 PM.

PredictText: Predict Text of an Edit Control Like Scite. | Remote Gmail: Execute your Scripts through Gmail. | StringRegExp: Share and learn RegExp. |

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). | Database: An easier approach for _SQ_LITE beginners. |

MathsEx: A UDF for Fractions and LCM, GCF/HCF. | FloatingText: An UDF for make your text floating. | Clipboard Extendor: A clipboard monitoring tool. |

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. |


#12 JohnOne

JohnOne

    John

  • Active Members
  • PipPipPipPipPipPip
  • 12,255 posts

Posted 18 July 2012 - 04:05 PM

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.

AutoIt Absolute Beginners Require a serial
 
 
OMG! Women are the cows of people.


#13 PhoenixXL

PhoenixXL

    be what you are, its always the BEST..

  • MVPs
  • 1,561 posts

Posted 18 July 2012 - 04:16 PM

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

PredictText: Predict Text of an Edit Control Like Scite. | Remote Gmail: Execute your Scripts through Gmail. | StringRegExp: Share and learn RegExp. |

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). | Database: An easier approach for _SQ_LITE beginners. |

MathsEx: A UDF for Fractions and LCM, GCF/HCF. | FloatingText: An UDF for make your text floating. | Clipboard Extendor: A clipboard monitoring tool. |

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. |


#14 JohnOne

JohnOne

    John

  • Active Members
  • PipPipPipPipPipPip
  • 12,255 posts

Posted 18 July 2012 - 04:24 PM

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...

AutoIt Absolute Beginners Require a serial
 
 
OMG! Women are the cows of people.


#15 JScript

JScript

    I'm back ... I miss, why not!

  • Active Members
  • PipPipPipPipPipPip
  • 1,218 posts

Posted 18 July 2012 - 06:34 PM

Simple and efficient, very helpful, avoid workarounds for the same purpose!
Thank you! 
João Carlos.
http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)
Spoiler

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!       





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users