Jump to content

RunAs does not work


 Share

Recommended Posts

Hello,

I allways create my scripts with the RunAsSet-Function.

After Upgrade to the newest AutoIt-Version, the new RunAs-Funktion does not the same as RunAsSet!

I allways get the Error: Unkonwn function name

Next you can see my script "iTunes-update.au3". This is a big issue, i have to update all of my iTunes-Installations based of security issues!

-----------------------------------------

if Not IsAdmin() Then

RunAs ("installadm", @ComputerName, "xxxx")

EndIf

DirCreate($pathc)

;Installation beginnen

FileCopy ($patho & $filename, $pathc & "iTunesSetup.exe", 0)

run ($pathc & "iTunesSetup.exe", $pathc)

;RunAs ("install", @ComputerName, "schrummdidu",1, $pathc & "iTunesSetup.exe", $pathc)

WinWaitActive ("iTunes + QuickTime", "Willkommen beim iTunes-Installationsprogramm")

Send ("{Enter}")

WinWaitActive ("iTunes + QuickTime", "Lizenzvertrag")

Send ("{TAB}")

Send ("{DOWN}")

Send ("!w")

WinWaitActive ("iTunes + QuickTime", "Installationsoptionen")

Send ("!i")

WinWaitActive ("iTunes + QuickTime", "Installation war erfolgreich!")

Send ("{SPACE}")

Send ("!f")

RunAs()

-----------------------------------------

HELP@Andreas

Link to comment
Share on other sites

Hello,

I allways create my scripts with the RunAsSet-Function.

After Upgrade to the newest AutoIt-Version, the new RunAs-Funktion does not the same as RunAsSet!

I allways get the Error: Unkonwn function name

Next you can see my script "iTunes-update.au3". This is a big issue, i have to update all of my iTunes-Installations based of security issues!

-----------------------------------------

if Not IsAdmin() Then

RunAs ("installadm", @ComputerName, "xxxx")

EndIf

DirCreate($pathc)

;Installation beginnen

FileCopy ($patho & $filename, $pathc & "iTunesSetup.exe", 0)

run ($pathc & "iTunesSetup.exe", $pathc)

;RunAs ("install", @ComputerName, "schrummdidu",1, $pathc & "iTunesSetup.exe", $pathc)

WinWaitActive ("iTunes + QuickTime", "Willkommen beim iTunes-Installationsprogramm")

Send ("{Enter}")

WinWaitActive ("iTunes + QuickTime", "Lizenzvertrag")

Send ("{TAB}")

Send ("{DOWN}")

Send ("!w")

WinWaitActive ("iTunes + QuickTime", "Installationsoptionen")

Send ("!i")

WinWaitActive ("iTunes + QuickTime", "Installation war erfolgreich!")

Send ("{SPACE}")

Send ("!f")

RunAs()

-----------------------------------------

HELP@Andreas

Hi,

you can use RunAs only, to run files under another credential, not your own program.

See Help:

RunAs ( "username", "domain", "password", logon_flag, "filename" [, "workingdir" [, show_flag [, opt_flag ]]] )

You have to use OS Function RunAs, to run your AutoIt Exe File as admin.

;-))

Stefan

Link to comment
Share on other sites

  • Developers

Hi,

you can use RunAs only, to run files under another credential, not your own program.

See Help:

RunAs ( "username", "domain", "password", logon_flag, "filename" [, "workingdir" [, show_flag [, opt_flag ]]] )

You have to use OS Function RunAs, to run your AutoIt Exe File as admin.

;-))

Stefan

HUH ?????

I have made many script that lauch itself with Admin credentials so do not understand this comment.

@OP: Have you checked the Helpfile for the supplied example?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

HUH ?????

I have made many script that lauch itself with Admin credentials so do not understand this comment.

@OP: Have you checked the Helpfile for the supplied example?

Hi,

see above:

if Not IsAdmin() Then

RunAs ("installadm", @ComputerName, "xxxx")

EndIf

In this case, i thought, you can't use RunAs to run your script with admin credentials.

Or does RunAs ("Admin", "Domain","xxxx") run your script with admin credentials????? ^_^

;-))

Stefan

Link to comment
Share on other sites

  • 2 months later...

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