将代码写入xxx.bat文件中,双击运行即可。
⚠操作涉及注册表
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client" /f
for /f "tokens=3 delims= " %%i in ('reg query ^"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders^" /v Personal') do ( set "personal=%%i")
for /f %%i in ('echo %personal%') do (set fold=%%i)
del /f /s /q "%fold%\Default.rdp" /a:h
pause