@echo off if 8332==%1 goto logon_ok NTNAME %USERNAME% >%TEMP%\OTHERPC.TXT if not errorlevel 1 goto logon_ok for /f %%f in ('TYPE %TEMP%\OTHERPC.TXT') do @echo Already logged onto %%f %0\..\logout.exe goto end :logon_ok net use t: \\madisona1\ctm$ /persistent:no :end