Welcome to the AutoIt Snippets thread
This section is dedicated to small reusable pieces of AutoIt code i.e. Snippets
They can be added to your script to give extra functionality without writing extra code. they are varied and cover many subjects like GUI's, Maths, Networking and many others.
Please visit the link above and you will find many examples to help you.
Many thanks for all the work from everybody who contributed to the original Autoit Wrapper
;~ #include <AutoItConstants.au3> ; needed For $STDERR_CHILD & $STDOUT_CHILD
Global $__g_RunWaitEx_sWorkingDir = @TempDir
Global $__g_RunWaitEx_iShowFlag = @SW_HIDE
Global $__g_RunWaitEx_iOptFlag = 6 ; ; "BitOR($STDERR_CHILD, $STDOUT_CHILD) = 6"
Global $__g_RunWaitEx_msTimeout = 0
; these helper functions return the set values, or sets the values if provided with one.
Func _RunWaitEx_WorkingDir($val = Default)