If you require the users full name in a domain logon script, include the following command in your
script:
for /f "Tokens=2*" %%m in ('net user %USERNAME% /domain ^| find "Full Name"' ) do set fname=%%nThe users full name will be set into the fname environment variable.
To use the fname environment variable, see the following example:
@echo Welcome %fname%.
If you require the users full name in a local logon script, include the following command:
for /f "Tokens=2*" %%m in ('net user %USERNAME% ^| find "Full Name"' ) do set fname=%%n
0 comments
Hide comments