Create whoison.bat in your path and call it with the full path to the file you want created:

whoison "<Drive:>\Folder\FileName.Txt"


Whoison.bat contains:

<b>
@echo off
setlocal
if "%1"<h1><a name="_goto_syntax_if_exist_1_del_q_1_goto_begin_syntax_echo_Syntax_Whoison_FileName_goto_end_begin_for_f_Skip_4_Tokens_i_in_net_session_do_call_parse_1_i_endlocal_goto_end_parse_set_str_2_set_str_str_if_str_">"" goto syntax
if exist %1 del /q %1
goto begin
:syntax
@echo Syntax: Whoison FileName
goto end
:begin
for /f "Skip=4 Tokens=*" %%i in ('net session') do call :parse %1 "%%i"
endlocal
goto end
:parse
set str=%2
set str=%str:"=%
if "%str%"</a></h1>"The command completed successfully." goto end
for /f "Tokens=*" %%i in ('@echo %%str:~23^,1%%') do set substr=%%i
if "%substr%"=="ECHO is on." goto end
@echo %str% >> %1
:end</b>