Jump to content

Question about running app as another user


Recommended Posts

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
Link to comment
Share on other sites

  • Moderators

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)

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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.

Edited by noobieautolearn
Link to comment
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( ͡° ͜ʖ ͡°)

Link to comment
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.
Link to comment
Share on other sites

  • Moderators

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.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...