Sign in to follow this  
Followers 0
ReaImDown

Why does this fail horribly?

15 posts in this topic

#1 ·  Posted (edited)

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]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

[center]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.[/center]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I am the sole user of the computer; one account; and I am admin... I shall take a look at that site though.

EDIT

I have full control.

Edited by ReaImDown

[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]

Share this post


Link to post
Share on other sites

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

Does anyone... really?

[center]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.[/center]

Share this post


Link to post
Share on other sites

There must be someone somewhere who understands it


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

Share this post


Link to post
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?

Share this post


Link to post
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


[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

There has to be a way to check if it's capable of running as an admin (super user) before calling #Isadmin and having it fail.


[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]

Share this post


Link to post
Share on other sites

It's because you're running every application automatically with admin rights. Someone enabled it on my work computer and now even this browser runs with admin rights. If I press Windows+R it will always show as:

Posted Image

You can check if you have a similar issue.

Share this post


Link to post
Share on other sites

I'm hoping for someone to come on and say I'm wrong, but I very much doubt that this will be possible unless you disable UAC

>> clickety-click <<

First link in Google:

Mal


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

Share this post


Link to post
Share on other sites

Isn't that why Isadmin() was made? Not to see if the program had admin rights; rather to see if the user did.


[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]

Share this post


Link to post
Share on other sites

Isn't that why Isadmin() was made? Not to see if the program had admin rights; rather to see if the user did.

IsAdmin() is made to do exactly what it does.

You are probably confusing it with something like


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Thank you kindly ma'am :) I was taking Isadmin() too literally :) cheers :P


[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]

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