@echo off
if "%OS%" == "" goto syntax
if %1z == z? set goto syntax
if %1z == z set /p UN=Enter UserName: &goto main
set UN=%1
:main
net send "%UN%" "Finding your computername. Press OK - do NOT respond." >nul
if errorlevel == 1 goto error
nbtstat -c > %TEMP%\LOCATE.LOG
findstr /i /c:%UN% %TEMP%\LOCATE.LOG >%TEMP%\LOCATE2.LOG
FOR /F "tokens=3,4,5,6,7 delims=. " %%i in (%TEMP%\LOCATE2.LOG) do ping -a -n 1 -l 1 %%j.%%k.%%l.%%m >%TEMP%\LOCATE.LOG
FOR /F "eol=: tokens=2" %%a in (%TEMP%\LOCATE.LOG) do @echo %UN% is logged into %%a&goto end
Echo This does not report whether %UN% is logged into multiple workstations!
del %TEMP%\LOCATE*.LOG
goto end
:error
cls
echo Error: %UN% username not found
goto end
:syntax
echo Syntax %0 username
echo Must be run from Windows NT or Windows 2000
echo NT/2000 users located, Win9x only if winpopup loaded.
goto end
:end
pause
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE