Lt Dan's legs Posted September 15, 2010 Posted September 15, 2010 How do you retrieve the windows user name? example C: -> Documents and Settings -> username Quote
Lt Dan's legs Posted September 15, 2010 Author Posted September 15, 2010 Thanks for the fast response. I guess i'm looking for the domain. example login: Username.domainname Password: •••••••••••• Quote
Lee Mac Posted September 15, 2010 Posted September 15, 2010 (getenv "USERDOMAIN") Or, more verbosely: (defun _GetDomainName ( / WSH result) (vl-load-com) (setq WSH (vlax-create-object "WScript.Shell")) (setq result (vlax-invoke WSH 'ExpandEnvironmentStrings "%USERDOMAIN%")) (vlax-release-object WSH) result ) Lee Quote
Lt Dan's legs Posted September 15, 2010 Author Posted September 15, 2010 (edited) (getenv "USERDOMAIN") (defun _GetDomainName ( / WSH result) (vl-load-com) (setq WSH (vlax-create-object "WScript.Shell")) (setq result (vlax-invoke WSH 'ExpandEnvironmentStrings "%USERDOMAIN%")) (vlax-release-object WSH) result ) Lee Correction! They both work great!! Thanks Lee Edited September 15, 2010 by Lt Dan's legs correction Quote
Lee Mac Posted September 15, 2010 Posted September 15, 2010 Correction! They both work great!! Thanks Lee You're very welcome Dan Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.