Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!caen!Firewall!uunet!mcsun!ukc!sys-uea!cmp8118 From: cmp8118@sys.uea.ac.uk (Dave Cartwright) Newsgroups: comp.sys.novell Subject: Re: Get username on LAN Message-ID: <1271@sys.uea.ac.uk> Date: 14 Jun 91 10:13:00 GMT References: <9106111142.AA26262@ucbvax.Berkeley.EDU> <1991Jun12.043538.31389@kuhub.cc.ukans.edu> Organization: UEA, Norwich, UK Lines: 33 maimer@kuhub.cc.ukans.edu writes: >> I want to get the username currently logged on (and running my program) in >> my program. I learned that this is not in the standard MS-DOS system calls. You're right - DOS doesn't really have concepts unique to network use like Login names, user ID's, etc, etc. >Can you access DOS memory variables? Yes. > The shareware program config.exe >can be used to set several DOS variables which includes login name, >dos version, etc. I believe this can also be done through the system login >script ("dos set name %login_name" or something like that). That's the way I do it. In the LOGIN script I set an environment variable LOGIN to the user's login name. As well as doing this, I make sure the user names are <=8 characters. That way I can set up personal network directories as P:\DATA\USER\%LOGIN%, so I can define everyone's private drive within the SYSTEM login script rather than having to bugger about with the individual users. This came in handy lately when I changed the layout of the system - I had to change one script, not 87. Dave C P.S. I'm speaking for me, not UEA. -- Dave Cartwright, | cmp8118@sys.uea.ac.uk or uk.ac.uea.sys School of Information Systems, | uucp : ...!ukc!uea-sys!cmp8118 University of East Anglia, | "Reality is an illusion brought on by Norwich, ENGLAND. NR4 7TJ. | lack of alcohol ..."