Jump to content

RunAs issue


Recommended Posts

Hi guys,

I'm having a RunAs issue.

I'm trying to start an autoit application I wrote  from within another autoit app with the runas command.

$app = "\\Server\Share\Path\To\File.exe"
RunAs($user, $domain, $password, 0, $app & " " & $command_line_switches, "")

When I execute this command I get error 1 and extended 740 (no explanation found so far)

Executing the exact same app using cmd works perfectly

$app = "C:\Windows\System32\cmd.exe /C START \\Server\Share\Path\To\File.exe"
RunAs($user, $domain, $password, 0, $app & " " & $command_line_switches, "")

Also another autoit app that is the "lite" version of this app (see $app) will start without the error 1 and extended 740

The only noticable difference is that the first app requires elevation

The app that executes the RunAs command is compiled and is already elevated

 

FYI 1 : I can run the application in $app perfectly from a desktop shortcut and also with runas.exe

FYI 2 : For UAC we have an app in our network called CyberArk which handles UAC popups and this application allows my autoit app to run without a popup, it just accepts the elevation, so this shouldn't be the issue

 

Anyone who has had this issue before or any ideas on how to fix this without using cmd?

Edited by colombeen
Link to comment
Share on other sites

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

I'm not sure Run(As) supports UNC paths.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Yeah that's not the issue... the "lite" version of the first app does work and is also on a network share :)

 

(@water: It is a "full" and "lite" version of my active directory tool I made with your UDF. Full version is for internal use, Lite version is for our customers)

Edited by colombeen
Link to comment
Share on other sites

Hi Adam, yeah that isn' t and issue... as water stated, it's an elevation issue (error 740 is ERROR_ELEVATION_REQUIRED system error)

I just think it's strange that other apps inherit the elevation and in this case it doesn't inherit it...

Maybe this is a limitation of the RunAs part? Could it be because the elevation is for a different user, it won't pass it on to the app started by the first app?

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...