I'm now looking for a way to see if the current user has admin rights.
I tryied the Iczelions way, and it always says that i dont have admin rights (on vista) . The next code i dont remember where i found, but it always says that the user has admin rights :
HMODULE hMod=GetModuleHandle("kernel32.dll"); FARPROC endreco=GetProcAddress(hMod, "MessageBox"); admin=IsBadCodePtr(endreco);
admin is always true.
Was thinking to use
net localgroup administrators | find "%USERNAME%"
, but there should be a better way, because the problem arrises on Non-us windows versions (for example in portuguese the AdministraTORs groups is called AdministraDOREs).
Any ideias ?