Le code est très bon mais encore plus rapide
Dim X
Dim U
Set X = createobject("WSCRIPT.Network")
U=x.UserName
Print U
Si le WSH (Windows scriptong host) est installé.
le WSH peut se trouver ici
http://www.microsoft.com/downloads/deta ... laylang=en
Ceci est normalement activé par défaut sur les postes windowzzzz. POur valider il faut un DLL . Il se trouve habituellement dans WinNt\system32\.
wshom - wshom.ocx - DLL Information
DLL File: wshom or wshom.ocx
DLL Name: Windows Script Host Runtime Library
Description:
ActiveX control used to create shortcuts, enumerate network drives, and so forth, by the Windows Scripting Host Object Model.
Ou bedon
Print Environ("UserName")
Il s'Agit d'une variable d'environnment Windows accessible via Environ()
JYR