Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#90 closed Bug (Fixed)

RunAs fails for a Limited User if run-as user's Profile is loaded

Reported by: DaveF Owned by: Valik
Milestone: Component: AutoIt
Version: Severity: Blocking
Keywords: beta, runas, profile Cc:


Using beta 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:

; 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
; Display result
MsgBox(0, "Debug", @AutoItVersion & " yields:" & @CRLF & $ourRead)

Attachments (0)

Change History (5)

comment:1 Changed 16 years ago by Valik

  • Owner set to Valik
  • Status changed from new to assigned

I must have forgotten to document it, but you *must* be an admin to use RunAs()/RunAsWait().

comment:2 Changed 16 years ago by Valik

  • Milestone Future Release deleted

comment:3 Changed 16 years ago by Valik

  • Severity set to Blocking

comment:4 Changed 16 years ago by Valik

  • Milestone set to
  • Resolution set to Fixed
  • Status changed from assigned to closed

Fixed in version:

comment:5 Changed 16 years ago by Valik

  • Milestone changed from to

Fixed in version:

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The owner will remain Valik.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.