Sign in to follow this  
Followers 0
FATIHTALI

Runas Problem in new version

16 posts in this topic

Hello I write a program when coulndt run correctly I have tried with that simple code.

When I start the program installation is starting and it is saying you are not administrator. But I used Local Administrator or domain administrator. nothing changed. so I tried to another pc and other version (v3.2.12.0). In my computer I have v3.2.12.1 and also I tried with beta. I have installed v3.2.10.0 to clear computer it worked well I updated v3.2.12.1 . It couldnt work again.

What is problem is there any one can help me?

CODE
If Not IsAdmin() Then

RunAs('username', "Domain", 'Password',0,@ComSpec,@SystemDir)

RunWait("c:\install_flash_player.exe")

MsgBox(0,"","complate")

EndIf


Startup Agent It is my small Startup Agent. You can install programs on startup Domain pc without Admin rights.

Share this post


Link to post
Share on other sites



I have tried this problem on my home computer. there is same problem. Program running but Installers are saying you must be admin.


Startup Agent It is my small Startup Agent. You can install programs on startup Domain pc without Admin rights.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

What is the RunAs supposed to do in your script?

Maybe you need to check the syntax in the helpfile as it doesn't set the account information as it used to do with RunAsSet().

Please post support questions in the support forum.

Jos

Edited by Jos

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

Share this post


Link to post
Share on other sites

I worked well. why it didnt work. oldies version it was working. I think code set changed..

Thanks.


Startup Agent It is my small Startup Agent. You can install programs on startup Domain pc without Admin rights.

Share this post


Link to post
Share on other sites

I think code set changed..

No shit, you think? Maybe read the changelog and you'd see that RunAsSet() was removed and replaced with new functions which have different behavior.

Share this post


Link to post
Share on other sites

I worked well. why it didnt work. oldies version it was working. I think code set changed..

Thanks.

It has changed. We have a lot more options now as well for specifying profile logons/using stdio, etc.

Share this post


Link to post
Share on other sites

well

Before I used like this

If Not IsAdmin() Then

RunAsset('username', 'domain', 'password')

end if

before between IF , ENDIF all aplication were running admin rights . But now it changed.

I must use "RunAsWait('username', "Domain", 'Password', 0, "c:\app.exe", @SystemDir)" like this....

how can Use other command with administrator permission .

example ProcessClose("OUTLOOK.exe") and any other command.

or how I can use like before..

Thanks.


Startup Agent It is my small Startup Agent. You can install programs on startup Domain pc without Admin rights.

Share this post


Link to post
Share on other sites

...

how can Use other command with administrator permission .

example ProcessClose("OUTLOOK.exe") and any other command.

or how I can use like before..

I think it's a good question.

How can i use the internal commands with admin rights when the script starts with user rights? I often use this when installing software ...


Wolfgang Führer

Share this post


Link to post
Share on other sites

I think it's a good question.

How can i use the internal commands with admin rights when the script starts with user rights? I often use this when installing software ...

You can't. You must start the script with admin rights. You can have the script prompt the user for admin rights by using #RequireAdmin or ShellExecute() with the "runas" verb. On Vista either of these two methods passes through UAC and runs the script with the proper elevated credentials.

Quite simply RunAsSet() did not work how most people thought it did and now they think they are missing functionality that never worked in the first place.

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

...snip...

Quite simply RunAsSet() did not work how most people thought it did and now they think they are missing functionality that never worked in the first place.

Really? What didn't work? I used to use it all the time and it always seemed OK to me.

So how do I get a script to run with elevated privileges without prompting the user now? With RunAsSet I could package the script as an exe and deploy, IIUC #RequireAdmin will prompt for credentials if the script is run under a lower account. Also, doesn't RunAs() require a filename to be passed to it, so it's for calling other programs, not running the script itself?? What if I don't want to call another program? What if I just want the commands between a RunAsSet(blah) and RunAsSet() to have elevated privileges? That was really useful.

If I'm correct then functionality has been removed from AutoIt. Progress? Don't think so!

Edited by zygote

Share this post


Link to post
Share on other sites

Really? What didn't work? I used to use it all the time and it always seemed OK to me.

So how do I get a script to run with elevated privileges without prompting the user now? With RunAsSet I could package the script as an exe and deploy, IIUC #RequireAdmin will prompt for credentials if the script is run under a lower account. Also, doesn't RunAs() require a filename to be passed to it, so it's for calling other programs, not running the script itself?? What if I don't want to call another program? What if I just want the commands between a RunAsSet(blah) and RunAsSet() to have elevated privileges? That was really useful.

If I'm correct then functionality has been removed from AutoIt. Progress? Don't think so!

Seriously... I thought Valik just explained that it DID NOT work how you think it did. RunAsSet was ONLY for the Run() and RunWait() functions. Basically RunAs gives you the ability to start a process with elevated rights. The rights of your process were assigned when it started and without a time machine will remain that way.

Lar.


f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

Share this post


Link to post
Share on other sites

Really? What didn't work? I used to use it all the time and it always seemed OK to me.

Then you either got lucky or you don't know what you're doing.

So how do I get a script to run with elevated privileges without prompting the user now? With RunAsSet I could package the script as an exe and deploy, IIUC #RequireAdmin will prompt for credentials if the script is run under a lower account.

That's UAC and that's it's job. It really has nothing to do with AutoIt.

Also, doesn't RunAs() require a filename to be passed to it, so it's for calling other programs, not running the script itself?? What if I don't want to call another program?

I guess you think the script is something magical and isn't a program which means there are filenames that can be used to re-run the script?

What if I just want the commands between a RunAsSet(blah) and RunAsSet() to have elevated privileges?

Then you'd need to take more drugs or go back to that fantasy land you were in BECAUSE IT WAS NEVER IMPLEMENTED TO DO THAT.

That was really useful.

I'm sure it was, but here in the real world, it wasn't because it simply did not work like that.

If I'm correct then functionality has been removed from AutoIt. Progress? Don't think so!

Wrong. The functionality was never in AutoIt. It has simply never existed in AutoIt. Nothing was removed. The behavior was changed and new features were added but everything you could do with RunAsSet() you can do with RunAs().

I repeat again, RunAsSet() only affected the Run() and RunWait() functions. It did not affect anything else, period. It simply could not because there was no code written to make it impersonate the user's credentials specified in RunAsSet(). The code did not exist to enable the functionality you people are imagining. I honestly don't know what's wrong with all you people who 1) think that it did; 2) continue to argue a developer saying that it did. It did not, it's very simple to test assuming you aren't 3 brain cells short of death.

Share this post


Link to post
Share on other sites

...snip irrelevant and pointless abuse from a supposedly intelligent person....

I repeat again, RunAsSet() only affected the Run() and RunWait() functions. It did not affect anything else, period. It simply could not because there was no code written to make it impersonate the user's credentials specified in RunAsSet(). The code did not exist to enable the functionality you people are imagining. I honestly don't know what's wrong with all you people who 1) think that it did; 2) continue to argue a developer saying that it did. It did not, it's very simple to test assuming you aren't 3 brain cells short of death.

OK, I get it, but Valik, why do you have to be such an ars3hole about it?

Jeeeesus!! :P

Share this post


Link to post
Share on other sites

First of all, I am an asshole. Second of all, where am I being an asshole in this thread? Third, who's the real asshole here? The person trying to explain something for the forty-seventh time or the people who question a developer - you know, somebody who has access to the source code and who can definitively say how something was/is supposed to work?

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0