Quick little bugfix and a third option added. See previous post.
I didn't bother to increment the version, as only one person had downloaded ... My apologies to that person.
I imagine that you can have "steps" in your script, and a file which tracks which steps or the last step in the process the script has performed. If this is part of an imaging process or some sort of task sequence, then you could log to either the local disk--if appropriate--or to a share folder.
I don't know very much about Windows ADK so I can't help you unless you detail about what script are you talking about, what it's suppose to do and how would you normally detect if it's interrupted. Then we can find a solution with AutoIt.
This is a basic prototype:
; Program starts here
; Maybe you want to check and load saved stuffs here
OnStart()
OnAutoItExitRegister('OnExit')
; Press ESC to exit the program
HotKeySet('{ESC}', 'Quit')
; Program code here
; ...
; Main loop to keep the program running
While True
Sleep(10)
WEnd
Func Quit()
Exit
EndFunc
Func OnExit()
ConsoleWrite('The program will close soon.' & @CRLF)
; Do your save stuffs here
EndFunc
Func OnStart()
ConsoleWrite('The program just started.' & @CRLF)
; Do your load stuffs here
EndFunc
you should not prevent the script from closing but in the 1st example it shows that you can save whatever setting you'd like to save from that function.
Unless you go into detail of what are you upto, this is all I'm gonna do.