This is the mail archive of the
mailing list for the Cygwin project.
Re: %USER% under Win95
- To: "David O'Shea" <s341595 at student dot uq dot edu dot au>, GNU-Win32 <gnu-win32 at cygnus dot com>
- Subject: Re: %USER% under Win95
- From: Grant Leslie <grantl at deerinet dot nb dot ca>
- Date: Sat, 01 Mar 1997 23:38:51 -0400
- Organization: Deer Island Internet Association
- References: <01BC2639.008D8FC0@supernova>
David O'Shea wrote:
> Would anyone know of a program, or be able to write one, which would
> set the %USER% environment variable under Windows 95? Or could someone
> tell me how to modify environment variables (the global ones, not the
> current process' ones)?
First you'll need to find the file winset.exe on the Win95 CD and place
it somewhere in your path.... This program works like the DOS set
command however it places the variable in the Global Enviroment.
Now the following script should work... I tested it some on my own
computer. The computer MUST be logged on the network before this will
# First set USERNAME to the current username
export USERNAME=$(net config | grep User | tr -s ' ' | tr A-Z a-z | cut
-f 3 -d ' ' )
# This line will place the var USERNAME in the Global Enviroment
# Now setup the HOME directory
# Create the appropriate /etc/passwd file
echo $USERNAME::500:500::$HOME:/bin/sh > /etc/passwd
For help on using this list, send a message to
"firstname.lastname@example.org" with one line of text: "help".