Sign in to follow this  
Followers 0
rmessing171

Infinite AutoIT Loop, Exit Compiled EXE to get Command Prompt Back

4 posts in this topic

#1 ·  Posted (edited)

Hello Everyone:

I am deploying a compiled AutoIT exe script via SCCM, however I have an infinite LOOP incorporated at the end of the script to display a message in the System Tray.  Via a Command Prompt, I have noticed that the EXE is waiting for the loop to complete before returning the Command Prompt back.  Is there a way to have the loop run infinitely and have the EXE return (an Exit Code of 0) and the command prompt with out breaking the loop?

The script with the infinite loop is below:

TraySetIcon("ActionCenter.dll",2)
TraySetToolTip ("Please restart your system")
Break(0) ;Disable break

While 1 = 1
   TrayTip("IT", "Critical updates have been installed on your system. Please save your work and restart your system as soon as possible.", 10, 1)
   Sleep (900000)
WEnd

Edited by rmessing171

Share this post


Link to post
Share on other sites



You can start a new script with that loop at the end of first script.

Share this post


Link to post
Share on other sites

Hello - Thank you for your quick response!

I am not sure I follow what you are suggesting.  Could you show me what I should I do to get this implemented?  Do I need to have two scripts?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I am bit unclear as to why your Traytip is in a loop.  You already set the timeout parameter for the traytip with the third parameter (10).  Why do you want that message to appear in a loop? Is it because you want it to last longer than 30 seconds?  If so, are you trying to have it show until the system is restarted?

JFish

P.S. @Melba23's >toast UDF may also be of interest to you.

Edited by Jfish

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

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