﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
90	RunAs fails for a Limited User if run-as user's Profile is loaded	DaveF	Valik	"Using beta 3.2.11.0 on XP SP2:

If the RunAs function is called in a script by a limited user, the RunAs function will fail if the target run-as user's Profile is already loaded; as in the case that another process has already been invoked with the run-as user's credentials with the option to load the user's profile. The failure occurs whether or not RunAs is called with the flag to force-load the run-as user's profile, and whether or not AutoIt spawned the earlier process that loaded the run-as user's profile.

Example code:

{{{
; N.B. MUST BE RUN AS A LIMITED USER TO EXHIBIT FAILURE
; declare yourself
Dim $ourPID, $ourPID0, $ourRead
; Run an initial process as the desired user
; This is only significant in this example in that
; it pre-loads the target user's profile; we could
; have right-clicked a program and chosen to Run As...
; this user and achieved the same effect.
$ourPID0 = RunAs(""is"", @ComputerName, ""smacksmack"", 1, @SystemDir & '\notepad.exe', @SystemDir)
; Run child task with option to access STDOUT
$ourPID = RunAs(""is"", @ComputerName, ""youwantanother?"", 1, @ComSpec & "" /c set"", @SystemDir, @SW_HIDE, 2)
; Read the child task's STDOUT output
While 1
  $ourRead &= StdoutRead($ourPID)
  If @error Then ExitLoop
WEnd
; Display result
MsgBox(0, ""Debug"", @AutoItVersion & "" yields:"" & @CRLF & $ourRead)
}}}
"	Bug	closed	3.2.11.12	AutoIt	3.2.11.0	Blocking	Fixed	beta, runas, profile	
