Sleep(8000) #cs -------------------------------------Program with computer restart logic------------------------------------- This particular ISO creates a shortcut during installation. First check if the shortcut (.lnk) file is present in the start menu programs. If it is not present, then the software needs to be installed. Call _prereboot to install. _RunOnce() has the registry function RegWrite() to re-call the script on reboot. After reboot, _postreboot function opens up the "American Poetry" software. -------------------------------------------------------------------------------------------------------------- #ce If not FileExists(@StartMenuCommonDir & '\Programs\EVENTS THAT CHANGED THE WORLD\EVENTS THAT CHANGED THE WORLD.lnk') Then _prereboot() Else _postreboot() EndIf func _prereboot() Run("D:\SETUP.EXE") WinWaitActive("Information") Send("{ENTER}") WinWaitActive("Installation Location") Send("{ENTER}") WinWaitActive("Begin Install") Send("!i") WinWaitActive("Check Existing Versions") Send("!s") WinWaitActive("Complete Install") Send("!i") WinWaitActive("Success") Send("!o") WinWaitActive("Information") _RunOnce() Shutdown(6) EndFunc Func _RunOnce() Local $key = 'HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce' If @Compiled Then RegWrite($key, '_AMPOET', 'Reg_sz', '"' & @ScriptFullPath & '" /postrun') Else RegWrite($key, '_AMPOET', 'Reg_sz', '"' & @AutoItExe & '" "' & @ScriptFullPath & '" /postrun') EndIf EndFunc func _postreboot() Run("D:\EVENTS.EXE") EndFunc