I have scripted FullName.bat to retrieve the current user's full name.
The syntax for using FullName.bat is:
FullName Name
where Name is a call directed environment variable that will contain the current user's full name.
FullName.bat determines if the current user is logged onto a domain, or logged on locally, and retrieves the full name from the domain, or local computer, accordingly.
FullName.bat contains:
@echo off if \{%1\}==\{\} @echo Syntax: Call FullName Name&goto :EOF setlocal if defined UserDNSDomain set dom=/domain for /f "tokens=2*" %%i in ('net user %username% %dom% ^| find "Full Name"') do set FullName=%%j endlocal&set %1=%FullName%
0 comments
Hide comments