jacQues Posted March 7, 2008 Share Posted March 7, 2008 I have an AutoIt application that checks for administrator rights with IsAdmin(). When the user has them, the application is allowed to update its configuration with IniWrite(), otherwise not. However, with Vista I'm running into problems as the UAC doesn't popup and IsAdmin() always returns FALSE. I cannot use #RequireAdmin as restricted users can then not use the application anymore (right?) I cannot simply write and hope that with a restricted user this will fail, as XP with FAT32 writing will work. So how can I let the application check if what type of user is used? jacQues Link to comment Share on other sites More sharing options...
Steph Posted March 7, 2008 Share Posted March 7, 2008 I needed something like this recently, have a look at this thread I started, I've posted what I use there.Steph Link to comment Share on other sites More sharing options...
rudi Posted March 7, 2008 Share Posted March 7, 2008 Hi.I needed something like this recently, have a look at this thread I started, I've posted what I use there.StephThat's nice if you have only English Windows Installations. In German e.g. the "Administrators" is "Administratoren", other localizations have even more different names.Also it's possible to rename the group "Administrators" to whatever you like...As the "Administrators" is a build in Group I can imagine, that they have something like Group-ID "0", so that that there might be some WinApi/DLL call getting a info like "Tell me if User <name> is member of <Build-in-Admins-Group>".Anybody who knows about that?Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
jacQues Posted March 7, 2008 Author Share Posted March 7, 2008 That's nice if you have only English Windows Installations. In German e.g. the "Administrators" is "Administratoren", other localizations have even more different names.Aaaarrgh! Back to square one. :-(Silly question, would a RegWrite() trigger the UAC popup to appear on Vista? (But not quit the AutoIt software if canceled). I could simply do something like this:FUNC IsAdminUser()RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\IsAdminUserTest","RandomValue","REG_DWORD",Random(1,4294967295,1))RETURN IsAdmin()ENDFUNCJust a wild idea... Got XP here and no good way to test anything Vista. Link to comment Share on other sites More sharing options...
rudi Posted March 10, 2008 Share Posted March 10, 2008 Hi.FUNC IsAdminUser()RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\IsAdminUserTest","RandomValue","REG_DWORD",Random(1,4294967295,1))RETURN IsAdmin()ENDFUNCJust a wild idea... Got XP here and no good way to test anything Vista.Well, as you want something for Vista I assume that you will have Vista "nearby", so pls. test it and let us know your results Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! 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