When using the RunAs or RunAsWait functions in AutoIt, you want to run an external program under the context of a different user. While doing this, there can be many things that may be the reason why the functions fails. The AutoIt Function Reference only states that if the function call failed that the return value is zero and that the @error flag is set to non-zero.