Batch file to restart RAAT on Windows (Local Windows endpoint disappears when computer goes to sleep when using Roon with VPN)

So I was having an annoying issue on my laptop. When I would use Roon at work over my Wireguard VPN occasionally I would pause my music and my laptop would go to sleep. Starting back up my laptops’s own endpoint would disappear until I exited Roon and re-opened it or disconnected from Wireguard and reconnected. I found that restarting RAAT on my computer would resolve this as well and is much more convenient, so I wrote a batch file to do it quickly. Since using Roon over a VPN isn’t a supported scenario I don’t expect this issue to be fixed, but I figured I can share the batch file on here just in case it helps someone else. This is really simple can be used as a shortcut to easily click and restart RAAT on Windows.

I hope it helps someone!

taskkill /f /im raatserver.exe
exit && cmd /c start "" %localappdata%\Roon\Application\raatserver.exe

Just to add to this, I had luck linking this to a scheduled task to run every time my machine wakes from sleep completely automating this. I just had to choose the correct event ID in event viewer.