This workaround is specifically for users of TVersity Media Server although it could be modified for other servers.

One of the problems I've been having and I know other people on the forum have been experiencing is that occassionally for no apparent reason the connection with the server is lost. The only way around this at the moment appears to be manually restarting the server.

To workaround this problem I have developed a little batch file which can be scheduled to run as a task so that it restarts the server when the connection is dropped.

Create a batch file called restarttv.bat with the following contents:

@echo off
set tv-port="41952"
netstat -o | find %tv-port%>nul
if errorlevel 1 goto restart
goto exit
:restart
net stop tversitymediaserver
net start tversitymediaserver
:exit

Then create another file in the same directory called runrestarttv.vbs with the following contents:

CreateObject("Wscript.Shell").Run "restarttv.bat", 0, False

The purpose of this second script file is to run the batch file without showing a command window.

You can then setup a scheduled task to run say every 10 minutes and point it at runrestarttv.vbs

NB: Port 41952 is the default for TVersity.

Last Edited By: bkearey 03/21/08 03:37:36. Edited 4 times.