@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
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.