This is the code I use:
@echo off
taskkill /f /t /im rdpclip.exe
for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (
%windir%\System32\tscon.exe %%s /dest:console /password:YOUR-WINDOWS-PASSWORD-HERE
)
ping 127.0.0.1
net stop NvContainerLocalSystem && net start NvContainerLocalSystem
To explain: the first taskkill line will kill the clipboard. I haven’t encountered the issue myself, but apparently some RDP clients can freak out the RDP server if tscon is invoked without quitting the clip app.