Created
May 18, 2021 14:59
-
-
Save jonshipman/508343f4b59b38104b02da860b5f2ae9 to your computer and use it in GitHub Desktop.
Restart NVIDIA Gamestream after RDP session
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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