Sign in to follow this  
Followers 0
daremo

Problem with IsAdmin

3 posts in this topic

Recently I've been having problems with IsAdmin()

It started happening after I installed Autoit 3.2.0.1

Here is a simple RunAsSet program:

RunAsSet($admin, @Computername, $password)

If IsAdmin() Then

Msgbox(0, "Status", "Admin Rights Detected")

Else

Msgbox(0, "Status", "Admin Rights Not Detected")

Endif

RunAsSet()

When I run this program...It always pops up that Admin Rights are Not Detected. Even when it's the correct administrator rights.

I've reinstalled previous versions and it still occurs. I didn't have this problem before I installed Autoit 3.2.0.1

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Recently I've been having problems with IsAdmin()

It started happening after I installed Autoit 3.2.0.1

Here is a simple RunAsSet program:

RunAsSet($admin, @Computername, $password)

If IsAdmin() Then

Msgbox(0, "Status", "Admin Rights Detected")

Else

Msgbox(0, "Status", "Admin Rights Not Detected")

Endif

RunAsSet()

When I run this program...It always pops up that Admin Rights are Not Detected. Even when it's the correct administrator rights.

I've reinstalled previous versions and it still occurs. I didn't have this problem before I installed Autoit 3.2.0.1

From what i understand it should not have worked at all for you.

Runasset works on Run() and Runwait() commands.

it will work if you make two files

1. runas.au3

2. isadmin.au3

in the runas put your runaset statement and run the compiled isadmin.au3

1. runas

RunAsSet("account","domain", "password")
RunWait("isadmin.exe")
RunAsSet()

2. isadmin

If IsAdmin() Then
Msgbox(0, "Status", "Admin Rights Detected")
Else
Msgbox(0, "Status", "Admin Rights Not Detected")
Endif

that worked for me.

let me know.

-Blademonkey

Edited by blademonkey

---"Educate the Mind, Make Savage the Body" -Mao Tse Tung

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I've reinstalled previous versions and it still occurs. I didn't have this problem before I installed Autoit 3.2.0.1

Doubt that....

RunAsSet() sets the credentials for Run() andRunWait() NO other functions.

You will have to re-launch your script with the New Credentials before ISAdmin() will "work" correctly for you.

Edited by JdeB

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

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  
Followers 0