I initially posted about this here and I also attempted at playing with task scheduler but that was too unreliable. Essentially the issue is that when my laptop enters modern standby and I use Roon over my wireguard VPN my local endpoint disappears until I either restart raatserver.exe, restart Roon, or disconnect and reconnect to Wireguard. My best attempt at a solution is the below Autohotkey script.
#+r::
Run cmd /c taskkill /f /im raatserver.exe
Run cmd /c exit && cmd /c start "" %localappdata%\Roon\Application\raatserver.exe
It can be compiled with Autohotkey and set to run at startup. Then all one has to to do bring the endpoint back is to press Win + Shift + R, then raatserver.exe will restart.
Edit:
I took some time and added some polish to this, complete with a more complex shortcut Shift+Win+Alt+R to make it harder to invoke. I also added a message box with a cancel button that will time out after 5 seconds. Code below:
!#+r::
MsgBox, 1,Roon,RAAT will restart in 5 seconds`, to stop this press Cancel., 5
IfMsgBox Cancel
exit
Else
Run cmd /c taskkill /f /im raatserver.exe
Run cmd /c exit && cmd /c start "" %localappdata%\Roon\Application\raatserver.exe