Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
June 19, 2002
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=%%n
The 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
You May Also Like