Jump to content
Sign in to follow this  
andik

RunAs does not work

Recommended Posts

andik

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

Share this post


Link to post
Share on other sites
99ojo

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

Share this post


Link to post
Share on other sites
Jos

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?


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
99ojo

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

Share this post


Link to post
Share on other sites
jerem488

I am using this function, but it don't work :)

I launch the program manually and it works, but not with the runas() function of Autoit...

WHY ??????


Qui ose gagneWho Dares Win[left]CyberExploit[/left]

Share this post


Link to post
Share on other sites
jerem488

The problem is solved !

I have changed the logon_flag option to 4 and, it works.

But, I don't know why it don't works with this option to 2 (credentials only) ......

Thank you


Qui ose gagneWho Dares Win[left]CyberExploit[/left]

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.