window2016远程连接无法复制

Cannot Copy and Paste via RDP

Sometimes the clipboard does not work in a Remote Desktop session if we actively use remote connections to workstations, Windows servers, or RDS farms using the RDP protocol.

We may come across two scenarios:

  • It does not allow copying files/data using RDP on a remote server
  • rdpclip.exe process crashes in the current user session

RDP Clipboard Stops Working in Remote Desktop Session

If we come across the clipboard issue, the best option is to end the current RDP session correctly (logoff) and reconnect.

However, it is not always convenient since we have to reopen everything again.

Fortunately, there is a way to restore the correct clipboard operation in an RDP session without logging off.

Rdpclip.exe is responsible for clipboard operation between our local computer and the Remote Desktop host.

A separate rdpclip.exe process starts for each remote user session when they connect to the Remote Desktop.

Using the Task Manager, we can kill the rdpclip.exe process and run it manually (Task Manager -> File -> Start new task -> rdpclip -> Enter).

Usually, it helps to restore the remote clipboard operation quickly. Ensure that copy/paste (Ctrl+C/Ctrl+V) is working in the RDP session.

In addition, in order to copy data via the RDP clipboard, the following conditions must be met:

First, we must enable the remote clipboard in the settings of the RDP client we use to connect to a remote computer.

Then we must allow to copy and paste data using the clipboard on the RDP/RDS host.

Allow/Prevent Copy and Paste via RDP Clipboard on Windows

We can enable or disable the use of the RDP clipboard using Group Policy or Registry settings.

  • Windows Server 2016
  1. Initially, run the Local Group Policy Editor: gpedit.msc
  2. Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Device and Resource Redirection.
  3. To prevent copying data to/from a remote server using the clipboard of an RDP session, Enable the following policies:
    a) Do not allow Clipboard redirection
    b) Do not allow drive redirection
  4. If we want to force using the RDP clipboard, change the values of the settings to Disable
  5. Then update the Group Policy settings using gpupdate /force.
  6. In order to apply new settings to users, we must end the RDP sessions (logoff instead of disconnect) or wait for automatic disconnection of user sessions according to RDS timeouts.
  • Windows Server 2012
  1. Initially, open “Server Manager“.
  2. Select Remote Desktop Services >> Collections >> Tasks
  3. Then choose “Edit Properties“.
  4. Under the “Client Settings” tab, ensure to enable the “Clipboard” and “Drive
  • Windows Server 2008
  1. Launch “Remote Desktop Session Host Configuration” from the server.
  2. Then under “Connections“, right-click the connection and select “Properties“.
  3. Select the “Client Settings” tab and make sure to uncheck the “Clipboard” box. If we want to allow copy and paste of files, make sure to uncheck the Drive selection.
  4. Eventually, click OK.

We can disable the RDP clipboard between a computer and a remote host as follows:

reg add “HKEY_LOCAL_MACHINE\Software\Microsoft\Terminal Server” / v “DisableClipboardRedirection” / t REG_DWORD / d 1 / f
reg add “HKEY_LOCAL_MACHINE\Software\Microsoft\Terminal Server” / v “DisableDriveRedirection” / t REG_DWORD / d 1 / f

If we use RDS hosts running on Windows Server, we can disable the clipboard and the local drives redirection:

  1. Remote Desktop Services -> Collections -> Tasks -> Edit Properties -> Client Settings.
  2. Uncheck Clipboard and Drives options in the Enable redirecting for the following section.

If we want to deny copying to/from an RDP session for users only, but not the administrators, we can change the NTFS permissions on the executable C:\windows\system32\rdpclip.exe.

To do it, uncheck Read/Execute permissions for the built-in Users group in the file’s security properties and remove the group from the list.

Client-Side Settings

  1. Right-click on the RDP icon that we use to connect, then select “Edit“.
  2. Then select the “Local Resources” tab.
  3. Check the “Clipboard” option. To allow file copying and pasting, select “More…”
    If we just need the ability to copy and paste text and not files, stop here and click “OK“.
  4. Otherwise, select the “Drives” option. Click “OK“, then “OK” again.

[Need help with the procedures? We can help you]

Conclusion

In short, we saw how to Allow/Prevent Copy and Paste via RDP Clipboard on Windows

posted @ 2021-05-26 09:41  叨叨勋  阅读(130)  评论(0编辑  收藏  举报