Well, I have made a .bat file that gives you options.
The problem is that I cant figure out how to save everything the program writes to a txt.
I already have it saving the time and renaming the file and such, as far as ive understood it should be after the .exe in the code.
ECHO @prompt set date=$d$_set time=$t$h$h$h > {a}.bat
%comspec% /e:2048 /c {a}.bat > {b}.bat
FOR %%v in ({b}.bat del) do call %%v {?}.bat
ECHO %date% %time% >> logonserverlog.txt
ECHO Logging logonserver
START /B /WAIT logonserver.exe
ECHO @prompt set date=$d$_set time=$t$h$h$h > {a}.bat
%comspec% /e:2048 /c {a}.bat > {b}.bat
FOR %%v in ({b}.bat del) do call %%v {?}.bat
ECHO %date% %time% >> logonserverlog.txt
FOR /F "tokens=1-5 delims=:" %%d in ("%time%") DO rename "logonserverlog.txt" %%d-%%e.txt
GOTO START
This is part of the code. What this is going to do (you probably understand just by looking) is make a file called logonserverlog.txt, save the date, and time and then whenever it shuts down or crashes (most likely crashes) then it will save the time there as well. It also renames the file to the time it stopped.
I also have an option of making it loop the start, so it automatically starts when it crashes.
Guessing that the command for exporting the text to the .txt has to be after the START.
Every comment is welcome.