delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/07/18/16:22:18

From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: User login name ?
Date: Tue, 18 Jul 2000 20:56:30 +0100
Organization: Customer of Planet Online
Lines: 24
Message-ID: <3974B66E.6ACADB13@phekda.freeserve.co.uk>
References: <bw1d5.17053$pD2 DOT 338143 AT news DOT tpnet DOT pl> <8l28aa$h49$1 AT plato DOT wadham DOT ox DOT ac DOT uk>
NNTP-Posting-Host: modem-4.tellurium.dialup.pol.co.uk
Mime-Version: 1.0
X-Trace: news6.svr.pol.co.uk 963951030 30959 62.136.43.4 (18 Jul 2000 20:10:30 GMT)
NNTP-Posting-Date: 18 Jul 2000 20:10:30 GMT
X-Complaints-To: abuse AT theplanet DOT net
X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.2.14 i586)
X-Accept-Language: de,fr
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hello.

J-P wrote:
> 
> Piotr Eljasiak <eljasiak AT NO-SPAM DOT zt DOT gdansk DOT tpsa DOT pl> wrote:
> > How can I get user login name ? getlogin() returns only value of env
> > var either $USER or $LOGNAME, and none of these vars is set by the
> > Win9x/NT4 system while user logging in.
> 
> The environment variable USERNAME is, I think, set by NT: I don't have
> WinXX to hand. If you can access environment variables, you can access
> that one.

Windows '95 doesn't seem to set this. The information is, however, stored
in a registry key, which can be accessed from DOS programs running under
Windows. libwin provides functionality to do this - please see:

http://www.phekda.freeserve.co.uk/richdawe/mysoft.html#libwin

Hope this helps, bye,

-- 
Richard Dawe
[ mailto:richdawe AT bigfoot DOT com | http://www.bigfoot.com/~richdawe/ ]

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019