Hi Guys
Can anybody put me in right direction, as to how can i
get a user name , i mean how can i get a Login Name used to
log on a computer where the Exe is Running?
In Windows 98 there is no 'automatic' USERNAME environemt variable, you have to create one. Create a small user logon script (batch file) which runs whenever the user logs on and sets an environment variable to the username, eg.
{EDWARD.BAT <-run when user Edward logs on.}
@WINSET LOGINNAME="EDWARD"
winset.exe is a file on the Windows98 CD hidden somewhere in ADMIN or NETTOOLS. Do a search. It 'permanently' sets environment variables that are accessable from within DOS programs and must be copied to a PATH directory, eg C:\WINDOWS
Then in the program use:
cUserName := GETENV("LOGINNAME"
If you're not familiar with logon scripts have a look at the WindowsNT forum or Microsoft site. If the computer is only used by one person, it could be placed in AUTOEXEC.BAT file.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.