一 rdpclip.exe
无法往服务器复制文件有以下2两种情况:
1、复制粘贴功能原本可以用,突然失灵了
2、从头到尾都无法使用这个复制粘贴功能
针对第一种情况,只需重启一下rdpclip.exe就可以了。
rdpclip.exe是 Windows Server 资源工具包中提供的 Rdpclip 实用程序,它的功能就是在“终端服务”客户端(本机)和“终端”服务器(远程服务器)之间复制和粘贴文件,也包括粘贴文本。这个程序的文件路径是 c:windows\system32\dpclip.exe
远程关闭剪贴板进程:
TASKKILL /S 10.109.50.252 /U administrator /P root821 /IM rdpclip.exe
二 远程桌面窗口分析
登陆进去之后:截取窗口消息;=》重置剪切板;
// TscShellAxHostClass
==》 ATL:00007FFC58414F60
==》 UIMainClass
==》 UIContainerClass
==》 IHWindowClass ==》 拦截键盘/鼠标消息;
三 远程桌面连接
现在我要实现这样一个功能,远程登录阿里云的服务器,然后把服务器上的一个文件拷贝下来。
想要在远程桌面(Remote Desktop,简称RDP)与本地系统之间传递文件,有两种方式,都需要在登陆远程桌面前设置:
方法一:
1.在登陆远程桌面的窗口中,展开【选项】,如图:
2.接着在展开的连接窗口中选择【本地资源】选项卡,如图
3.勾选【剪贴板】
这样连接后,就可以通过本地和远程桌面的【拷贝】【粘贴】操作,进行数据的传送,本方法不限文件,还可以传递文字、图片等等。
四 远程连接代码如下
https://www.cnblogs.com/wuguoqiang/p/9371805.html
CString strServerUsername = m_stLoginSeverInfo.strServerName;
CString strServerPassword = m_stLoginSeverInfo.strServerPassword;
CString strServerIP = m_stLoginSeverInfo.strServerIP;
CMsRdpClientAdvancedSettings6 m_MsRdpClientAdvancedSettings(m_RemoteDesktopControl.get_AdvancedSettings());
m_RemoteDesktopControl.put_Server(strServerIP);
m_RemoteDesktopControl.put_UserName(strServerUsername);
m_MsRdpClientAdvancedSettings.put_ClearTextPassword(strServerPassword);
m_RemoteDesktopControl.put_DesktopWidth(nScreenWidth);
m_RemoteDesktopControl.put_DesktopHeight(nScreenHeight);
m_RemoteDesktopControl.put_ColorDepth(32);
m_MsRdpClientAdvancedSettings.put_RedirectClipboard(TRUE); // 设置允许剪贴板
m_MsRdpClientAdvancedSettings.put_EnableCredSspSupport(TRUE);//
m_MsRdpClientAdvancedSettings.put_Compress(1);
m_MsRdpClientAdvancedSettings.put_BitmapPeristence(1);
m_MsRdpClientAdvancedSettings.put_singleConnectionTimeout(20);
m_RemoteDesktopControl.put_ConnectingText(_T("请稍后......"));
m_RemoteDesktopControl.Connect();
五 远程控制服务端:
1:注册表项fDenyTSConnections
注册表fDenyTSConnections键值0(开启),可以通过pc自带的远程工具连接上:
HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Terminal Server”项目,然后在右栏中找到“fDenyTSConnections”键,双击打开后将该键值修改为“0”,点击“确定”按钮。
2:工具开启或是关闭
启用Win10家庭版的远程桌面服务端:可以修改远程桌面服务端的端口和启用状态;
https://blog.csdn.net/sinat_34439107/article/details/83030348