DOS Questi

Jakev3

Banned
Jul 21, 2002
125
0
0
I have a file called file.bat on my computer. When the user clicks on it, i want it to capture the user's login name (NT) and store in a variable (i.e., $username would replace with the real username of that user). What variable/code do i put into the this bat file? Someone told me this can be done. I'm clueless about DOS, so please help me out.
 

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
the environment variable "USERNAME" appears automatically when i open a command prompt in XP...
 

Bozz

Senior member
Jun 27, 2001
918
0
0
What he said

For example, this basic command will append each user that logs on to the file "users.txt" if you put it in the logon script

@echo %username% >>c:\users.txt