Jump to content

Restart Script button


Recommended Posts

ADMIN: When this post is edited all the text get garbled, perhaps there is a bug? Try editing this post to see what you get

This is a pretty complex script, so I've pasted the necessesary info below but the only thing I'm having problems with is the "Restart Program" button on the GUI

When the Restart Program button is pressed the follow happens:

Case $msg = $RestartGUIButton
                GUICtrlSetData($RestartGUIButton, "Restarting...") ;This is just a label box that displays
                Sleep(500)
                GUIDelete($MainGUI)
                Sleep(100)
                Run(@AutoItExe & " " & @ScriptName, @ScriptDir & "\")
                exitoÝ÷ Ù«­¢+ÙÕ¹=¹Õѽ%Ñá¥Ð ¤(%Q½½±Q¥À ÅÕ½Ðíá¥Ñ¥¹ÅÕ½Ðì°À°À°ÅÕ½Ðí1=QI=    ½ÐÅÕ½Ðì°Ä¤(%%]¥¹á¥ÍÑÌ ÀÌØí1=QI=]¥¹½Ý9µ¤Ñ¡¸($$íQ¡¥Ìչѥ½¸áÕÑ̽¸ÍÉ¥ÁÐá¥Ð($%%ÀÌØí5½Ù¥¹½ÉÝÉôÄQ¡¸M¹]¥Ñ¡=ÁÑ¥½¹Ì ÀÌØíÕѽ5½Ù   ¥¹°Ä°À¤($%M¹]¥Ñ¡=ÁÑ¥½¹Ì ÅÕ½ÐííU@½Ý¹õíU@UAõíÍôÅÕ½Ðì°È°Ä¤í%íUÀ½Ý¹ô½µµ¹¡Ì¸áÕÑ°Ñ¡¥ÌÝ¥±°ÐÉ¥½¥Ð(%¹%(%M±À ÔÀÀ¤)¹Õ¹ìôôÐí=¹Õѽ%Ñá¥

Is this happening because the script is still being used? I am able to open multiple copies of the script at once. I'm really just looking for a way to quickly restart the program after I make changes to the script, and a button in the GUI is the most convinent way to do this.

To test the script just push OK when it asks if you want to continue offline. Then push the "Restart Program" button

Edited by BotXpert
Link to comment
Share on other sites

Do you have spaces in your Path?

Use This:

Func _restart($params = "")
    If @Compiled Then
        Run('"'&@ScriptFullPath&'" ' & $params,@WorkingDir)
    Else
        Run('"' & @AutoItExe & '" "' & @ScriptFullPath & '" ' &$params,@WorkingDir)
    EndIf
    Exit
EndFunc
Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Do you have spaces in your Path?

Use This:

Func _restart($params = "")
    If @Compiled Then
        Run('"'&@ScriptFullPath&'" ' & $params,@WorkingDir)
    Else
        Run('"' & @AutoItExe & '" "' & @ScriptFullPath & '" ' &$params,@WorkingDir)
    EndIf
    Exit
EndFuncoÝ÷ Ûú®¢×©ä²+p¢¹,r§çZºÚ"µÍ[]]Ò]^H [È ][ÝÈ  ][ÝÈ  [ÈØÜ[YKØÜ  [È ][ÝÉÌLÉ][ÝÊoÝ÷ ÚÚºÚ"µÍ[   ÌÎNÉ][ÝÉÌÎNÈ    [È]]Ò]^[È ÌÎNÉ][ÝÈ   ][ÝÉÌÎNÈ   [ÈØÜ[]   [È ÌÎNÉ][ÝÈ   ÌÎNÊ

The weird this is that it worked on a much much earlier version of the script.

Thanks again!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...