Shellexecute en tant qu'administrateur

Herve_be Messages postés 1017 Date d'inscription mercredi 4 août 2010 Statut Membre Dernière intervention 25 avril 2024 - Modifié le 7 mars 2020 à 12:16
vb95 Messages postés 3474 Date d'inscription samedi 11 janvier 2014 Statut Contributeur Dernière intervention 7 mai 2024 - 10 mars 2020 à 03:38
Bonjour,
En faisant ceci
lngReturn = ShellExecute(Me.hWnd, vbNullString, UpgradeFileName, vbNullString, App.Path, SW_SHOWNORMAL)

j'ai parfois lngReturn = 5 : The operating system denied access to the specified file
Est-il possible de lancer un exe en tant qu'administrateur à l'aide de shellexecute ?
A voir également:

1 réponse

vb95 Messages postés 3474 Date d'inscription samedi 11 janvier 2014 Statut Contributeur Dernière intervention 7 mai 2024 169
Modifié le 10 mars 2020 à 03:42
Bonjour
Peut-être une réponse ici sans certitude : https://www.it-swarm.dev/fr/delphi/utiliser-shell-execute-pour-executer-cmd-en-tant-quadministrateur/1070957174/
Ce qui donnerait
lngReturn = ShellExecute(Me.hWnd, "runas", UpgradeFileName, vbNullString, App.Path, SW_SHOWNORMAL)


0
Rejoignez-nous