cyberalau3

Exit then auto restart a autoit exe

5 posts in this topic

Is it possible to exit a AutoIt exe script then automatically restart the same script?

Thanks in advance

cyberalau3

Share this post


Link to post
Share on other sites



Could ShellExecute/Run() your exe then exit, or create a .bat file that watches the current execution of your exe and waits till it's closed, then restart the exe.

Share this post


Link to post
Share on other sites

@cyberalau3 if you need to perform repeatable steps, then you should be putting those steps in a function. You can then call that function as many times as needed, without all this stopping and relaunching mess. If you provide some actual info regarding what you're trying to accomplish, we can certainly assist you further.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

I have a small backup utility that I wrote and have 2 monitors. My wife has only one but I wanted it to run on my 2nd monitor and on her PC with only 1 monitor. I can get all the windows and so forth to show on my 2nd monitor by using negative horizontal positions. I have a text file that I investigate when I first start the application to see if it wants to run on my second monitor or on my wife's primary monitor. But at times I want to run it on either my 1st or 2nd monitors. So I have a option to switch from 1st to 2nd and vice versa, but when I do switch, I have to exit then manually restart for the change to take effect. I thought if I could just automate the exit and restart it would be smoother. Hope this helps. I know a little about DOS batch files so I will try your approach.

Thanks so much for your suggestion and I will try to do this myself.  Just a old fart that still loves to do this kind of stuff.

Thanks much

cyberalau3

Share this post


Link to post
Share on other sites

When you know how to switch between monitors, make a func which switches on runtime.

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