THE BORE

General => The Superdeep Borehole => Topic started by: mojovonio on April 08, 2011, 03:37:43 PM

Title: Computer IT Bore, I need your help
Post by: mojovonio on April 08, 2011, 03:37:43 PM
Does something like %username% exist but for the users pre-2000 account name?
Title: Re: Computer IT Bore, I need your help
Post by: Corporal on April 12, 2011, 04:34:38 PM
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 (http://freebooks.by.ru/view/SambaIn24h/ch23-05.htm) 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%