>>Thanks for the suggestion Ken. Unfortunately, when run in FoxPro 2.6, both the ID() and sys(0) functions return the machine name in the following form: "9JHP4 # 255". In VFP, both of the functions return the name in this form: "9JHP4 #VALIDNAME". It seems the 16 bit version returns only the machine number.
>
>For NT Workstation Try:
>set default to c:\winnt\system (or wherever your windows system folder is located)
>
>! net config workstation >c:\netuser.txt then parse the file low level. I believe the user will be the second line in the output file.
>
>For Windows 95/98 I'm not sure look at the net command switches by opening a dos session and typing net /? in the windows subdirectory.
NT has a default environment variable called username.
I use GETENV('username')
Also, our Netware login script creates a similar environment variable for DOS/Win/95 users.
This has some security issues. But in 95, the user has to run the app from a batch file that changes the environment variable and then runs the app because just changing an envar in a DOS window doesn't affect anything but that DOS session.
Cheryl Qualset
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement