Rutina para determinar si el Usuario actual de Windows es Administrador.
#DEFINE NO_ERROR 0 DECLARE INTEGER IsUserAnAdmin IN shell32 DECLARE INTEGER WNetGetUser IN mpr; INTEGER lpName, STRING @lpUserName, INTEGER @lpnLength LOCAL lcUser, lnBufsize lnBufsize = 250 lcUser = Repli(Chr(0), lnBufsize) IF WNetGetUser(0, @lcUser, @lnBufsize) = NO_ERROR ? "Nombre de Usuario:", SUBSTR(lcUser, 1, AT(Chr(0),lcUser)-1) ? "Es Administrador:", Iif(IsUserAnAdmin()=0, "No", "Si") ENDIF
Saludos.
Jesus Caro V
En el artículo de Berezniker, se observa que IsUserAnAdmin() sería descontinuada desde Win8.
ResponderBorrarIs Current User In Admin Group - Windows 10
https://www.tek-tips.com/viewthread.cfm?qid=1790212
Find if User is An Admin in Windows 7 (Visual Foxpro Function)
http://sourcecodefox.blogspot.com/2015/12/isuseranadmin.html
Windows Administrator Group
https://social.msdn.microsoft.com/Forums/en-US/a94d4495-0a7f-4d67-aff5-ad7712202fac/windows-administrator-group?forum=visualfoxprogeneral
https://www.berezniker.com/content/pages/visual-foxpro/-user-member-administrators-group
Is user a member of the Administrators group
https://www.berezniker.com/content/pages/visual-foxpro/-user-member-administrators-group