Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to check if .exe is running as Admin on Vista
Message
De
28/03/2008 09:56:34
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01305105
Message ID:
01306464
Vues:
3
Hi Sergey,

This change still returns .T. even though I did not choose to run as admin.

Jos



>Hi Jos,
>
>I don't have Vista (and plan not to have it) so I cannot run tests. Try following change and let me know result.
>
>	* WMI
>	*loLocator = CREATEOBJECT('WBEMScripting.SWBEMLocator')
>	* Local computer, logged on user
>	*loWMIService = loLocator.ConnectServer()
>	loWMIService = GetObject("Winmgmts:{impersonationlevel=impersonate}!//./root/cimv2")
>
>
>>
>>On my Vista machine example #1 on your webpage returns .F. but example #3, using WMI, returns .T.
>>
>>If I then load VFP "As Administrator" then both return .T. correctly.
>>
>>It seems to me that the first example is the correct one. Why does WMI return .T. if I did not load VFP as an Administrator? Is it because my login is part of the Administrators group?
>>
>>
>>
>>>Check http://berezniker.com/content/pages/visual-foxpro/-user-member-administrators-group
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform