Jump to content

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


Recommended Posts

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

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

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