Sign in to follow this  
Followers 0
noobieautolearn

Question about running app as another user

7 posts in this topic

#1 ·  Posted (edited)

Lets say you launch an exe as another user, from what I have seen you will not see the window it generates as it is running in another user account.  Can/does autoit push buttons on say an install that is launched as another user even though the currently logged on user cannot see it if the your autoit exe file is running as the same admin user the install it?

Edited by noobieautolearn

Share this post


Link to post
Share on other sites



You can run an application as another account and still click on buttons, yes. Look at the example for RunAs in the help file. You could change it to this:

Local $sUserName = "<user name>"
Local $sPassword = "<password>"
Local $sDomain = "<domain>"

Local $iPID = RunAs($sUserName, $sDomain, $sPassword, 0, "notepad.exe", "", @SW_SHOWMAXIMIZED)
    WinWait("[CLASS:Notepad]", "", 10)
    ;Look in Task Manager to confirm you are running the executable as the specified user.

ControlSend("[CLASS:Notepad]", "", "Edit1", "Some text sent by " & $sUserName)

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

In your example it launches notepad as another user and then shows it to you on the desktop of whatever user you are in.  Is it possible for say a software install for the exe to remain hidden, unseen to the user that is logged on and to run install steps behind the scenes?  I got a au3 script, that works when you launch it normally but when I have sccm launch it as a command running as an admin I think the AU script doesn't see the install window.  I'm curious if there is a command or a way to code it so that AU script will see the install behind the scenes so that it can push the buttons on the install needed.  

I know about switches and answer files that you would normally use for apps but it doesn't work right with this particular app I am trying to get to work.

Edited by noobieautolearn

Share this post


Link to post
Share on other sites

Keep in mind the only thing that wont work is the option to drag a file onto your autoit program being run with a Runas.

This is a security feature in windows.


C0d3 is P0etry( ͡° ͜ʖ ͡°)

Share this post


Link to post
Share on other sites

In your example it launches notepad as another user and then shows it to you on the desktop of whatever user you are in.  Is it possible for say a software install for the exe to remain hidden, unseen to the user that is logged on and to run install steps behind the scenes?

 

If the software package you are installing has popups, there is not much of a way to get around that unless it is an MSI, then you an run it with msiexec which has command line switches.


C0d3 is P0etry( ͡° ͜ʖ ͡°)

Share this post


Link to post
Share on other sites

If you use paexec, or a scheduled task, you can run your script on session 0 (behind the desktop)...you can then run your installer there, and manipulate it there as well.  Much easier if there are silent switches, but you can still interact with the windows behind the desktop (if the script is being executed in the same context)...

https://www.autoitscript.com/wiki/FAQ#Why_doesn.27t_my_script_work_on_a_locked_workstation.3F


IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

In your example it launches notepad as another user and then shows it to you on the desktop of whatever user you are in.  Is it possible for say a software install for the exe to remain hidden, unseen to the user that is logged on and to run install steps behind the scenes?  I got a au3 script, that works when you launch it normally but when I have sccm launch it as a command running as an admin I think the AU script doesn't see the install window.  I'm curious if there is a command or a way to code it so that AU script will see the install behind the scenes so that it can push the buttons on the install needed.  

I know about switches and answer files that you would normally use for apps but it doesn't work right with this particular app I am trying to get to work.

 

This is a prime example of information that would have been useful in your first post. Handling an install through Altiris or SCCM is a whole different ball game than

Lets say you launch an exe as another user...

 

So, now that we're getting down to the actual issue. What account are you running the install as (SYSTEM or SCCM service account)? What is the product you are installing, and the format (EXE or MSI)? You should be able to configure something through a Task Sequence either way, but whatever information you can provide will help us help you.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0