ReaImDown Posted March 23, 2011 Share Posted March 23, 2011 (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 March 23, 2011 by ReaImDown [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 23, 2011 Moderators Share Posted March 23, 2011 (edited) Works for me on Windows 7 x64 full admin without #RequireAdminI 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 March 23, 2011 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 More sharing options...
ReaImDown Posted March 23, 2011 Author Share Posted March 23, 2011 (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 March 23, 2011 by ReaImDown [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted March 23, 2011 Share Posted March 23, 2011 It sounds like you have UAC enabled but has no idea what it does.Wikipedia - User Account Control .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 23, 2011 Moderators Share Posted March 23, 2011 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 More sharing options...
Mallie99 Posted March 23, 2011 Share Posted March 23, 2011 There must be someone somewhere who understands it Are you telling me something I need to know or something I want to know? Link to comment Share on other sites More sharing options...
Mallie99 Posted March 23, 2011 Share Posted March 23, 2011 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() EndIfI 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 More sharing options...
ReaImDown Posted March 23, 2011 Author Share Posted March 23, 2011 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] Link to comment Share on other sites More sharing options...
Mallie99 Posted March 23, 2011 Share Posted March 23, 2011 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 lolIt 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 More sharing options...
ReaImDown Posted March 23, 2011 Author Share Posted March 23, 2011 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] Link to comment Share on other sites More sharing options...
jvanegmond Posted March 23, 2011 Share Posted March 23, 2011 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:You can check if you have a similar issue. github.com/jvanegmond Link to comment Share on other sites More sharing options...
Mallie99 Posted March 23, 2011 Share Posted March 23, 2011 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? Link to comment Share on other sites More sharing options...
ReaImDown Posted March 23, 2011 Author Share Posted March 23, 2011 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] Link to comment Share on other sites More sharing options...
trancexx Posted March 23, 2011 Share Posted March 23, 2011 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 Link to comment Share on other sites More sharing options...
ReaImDown Posted March 23, 2011 Author Share Posted March 23, 2011 Thank you kindly ma'am I was taking Isadmin() too literally cheers [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now