Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jonshipman/508343f4b59b38104b02da860b5f2ae9 to your computer and use it in GitHub Desktop.
Save jonshipman/508343f4b59b38104b02da860b5f2ae9 to your computer and use it in GitHub Desktop.
Restart NVIDIA Gamestream after RDP session
@echo off
REM kill the RDP clipboard to prevent errors...
taskkill /f /t /im rdpclip.exe
REM disconnects all active RDP sessions...
for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (
%windir%\System32\tscon.exe %%s /dest:console
)
REM wait 4 seconds...
ping 127.0.0.1
REM restarts gamestream as it was halted when RDP connects...
net stop NvContainerLocalSystem && net start NvContainerLocalSystem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment