Discussion:
how to get current domain user
(too old to reply)
snarj
2004-05-04 11:01:07 UTC
Permalink
Hello there

I am using VFP 6.0 and need to know, is there any way to get current windows user name so that user should not bother to type user name and password
Looking forward for favorable response

Regards
snarj
Eric den Doop
2004-05-04 11:08:55 UTC
Permalink
Hello, snarj!
You wrote on Tue, 4 May 2004 04:01:07 -0700:

s> I am using VFP 6.0 and need to know, is there any way to get current
s> windows user name so that user should not bother to type user name and
s> password. Looking forward for favorable response.

SYS(0)
--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8
Olaf Doschke
2004-05-04 14:33:41 UTC
Permalink
Post by Eric den Doop
SYS(0)
Also take a look at what GETENV gives you:
GETENV("COMPUTERNAME")
GETENV("USERNAME")
GETENV("USERDOMAIN")
...

Bye, Olaf.
Neil Waterworth
2004-05-04 19:35:21 UTC
Permalink
Post by Olaf Doschke
Post by Eric den Doop
SYS(0)
GETENV("COMPUTERNAME")
GETENV("USERNAME")
GETENV("USERDOMAIN")
...
Or for a no doubt OS dependent way,

oNet = CreateObject("WScript.Network")
? oNet.ComputerName
? oNet.UserName
? oNet.UserDomain

Regards,
Neil

Loading...