Huh. I'm guessing you're scripting for a Pre-2000 (= 9x/NT) system and want to know the environment variable for the current user login name? Did I understand that correctly?
I'd fiddle around with set on the machine in question to find the correct name. If it exists, that is.
Way I see it you're SOL on 9x machines. Those rely heavily on their DOS underpinnings and thus autoexec.bat (or winset.exe from the Admin folder of the CD).
Hah,
found a way involving scripting on a samba server... Might achieve the same using a genuine DC, but dunno, really.
Win NT and onwards all should have the username environment variable.
Some googling turned up a tool named "putinenv.exe" that you can use in conjunction with winset on 9x machines:
\\server\netlogon\putinenv L /L
\\server\netlogon\winset username=%username%
\\server\netlogon\winset computername=%computername%