Jump to content

Problem with IsAdmin


daremo
 Share

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Developers

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

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

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