直接上码供参考
1 @echo OFF 2 color 0a 3 Title Clear Windows Recent 4 Mode con cols=109 lines=30 5 :START 6 ECHO. 7 Echo ========================================================================== 8 ECHO. 9 Echo Clear Windows Recent 10 ECHO. 11 Echo ========================================================================== 12 Echo. 13 echo. 14 echo. 15 :TUNNEL 16 ECHO. 17 ECHO. 18 ECHO. 19 ECHO. %UserProfile%AppDataRoamingMicrosoftWindowsRecentAutomaticDestinations 20 ECHO. %UserProfile%AppDataRoamingMicrosoftWindowsRecentCustomDestinations 21 del /f /s /q %UserProfile%AppDataRoamingMicrosoftWindowsRecentAutomaticDestinations*.* 22 del /f /s /q %UserProfile%AppDataRoamingMicrosoftWindowsRecentCustomDestinations*.* 23 del /F /S /Q /AH %UserProfile%DocumentsDefault.rdp 24 reg delete "HKEY_CURRENT_USERSoftwareMicrosoftTerminal Server ClientDefault" /va /f 25 26 PAUSE 27 goto TUNNEL
关键点说明:
1.清理windows访问记录,包含在任务栏上右键出现最近访问的程序的记录
%UserProfile%AppDataRoamingMicrosoftWindowsRecentAutomaticDestinations
%UserProfile%AppDataRoamingMicrosoftWindowsRecentCustomDestinations
2.删除远程桌面的记录文件
%UserProfile%DocumentsDefault.rdp
3.清除注册表中远程桌面地址下拉列表内容
"HKEY_CURRENT_USERSoftwareMicrosoftTerminal Server ClientDefault" /va /f