Jump to content

Why does this fail horribly?


Recommended Posts

here is my code:

If Not IsAdmin() Then

MsgBox(0, "Problem...", "The settings cannot open because you are not a computer administrator...")

endscript()

Else

ShellExecute($Location & "Settings.exe")

endscript()

EndIf

I am an admin on windows 7, and I always get the msgbox.

any idea?

EDIT:

I DO NOT want to use #requireadmin in the script. I merely would like to check if they are running under an admin account.

Edited by ReaImDown
[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]
Link to comment
Share on other sites

  • Moderators

Works for me on Windows 7 x64 full admin without #RequireAdmin

I guess the obvious question(s):

1. Are you sure you have admin privileges.

2. Are you sure you have full admin privileges?

Edit:

Take a look at this and see if it changes if you make the change:

http://www.webtlk.com/2010/04/29/how-to-get-full-administrator-rights-in-windows-7/

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

It sounds like you have UAC enabled but has no idea what it does.

Does anyone... really?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

here is my code:

If Not IsAdmin() Then

MsgBox(0, "Problem...", "The settings cannot open because you are not a computer administrator...")

endscript()

Else

ShellExecute($Location & "Settings.exe")

endscript()

EndIf

I am an admin on windows 7, and I always get the msgbox.

any idea?

EDIT:

I DO NOT want to use #requireadmin in the script. I merely would like to check if they are running under an admin account.

Windows7 (from Windows Vista) does not by default run programs as an administrator, this is to get round Nasties that get written by ppl to get your money from you. The best way to test this is to right-click on the compiled app and then select "Run as administrator".

Are you telling me something I need to know or something I want to know?

Link to comment
Share on other sites

I don't care to have it run as an admin... Isadmin() is supposed to see of the user is, or is not running on an admin account... And it fails horribly lol

It will always report "False" in that case. If you are at all familiar with Linux, UAC is the equivalent of SUDO. With it you are always using a low security account until you inform the system to run the required command using elevated permissions.

Mal

Are you telling me something I need to know or something I want to know?

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