You can use the clipboard in an RDP session to copy/paste text and files between a local computer and a remote host (this can be either a Windows workstation or an RDS farm on a Windows Server). Sometimes the clipboard in the Windows Remote Desktop session (or RemoteApp) stops working and you cannot transfer (copy/paste) your text or files between your computer and the RDP server.
Several scenarios are possible: check that clipboard redirection is enabled on the RDP client, check that the RDS host allows files/data to be copied via the RDP clipboard, or restart the failed rdpclip.exe
process in the user’s current terminal session.
Restart the Rdpclip.exe (RDP Clipboard) Process in Windows
If the clipboard suddenly stops working in the RDP session, and the Paste option in the context menu has become inactive, the easiest way is to gracefully end the current RDP session (logoff) and reconnect. This will fix the Remote Desktop clipboard issue for sure. However, this is inconvenient as you will need to restart all applications in an RDP session. Fortunately, there is a way to restore the correct clipboard operation in an RDP session without logging off.
Rdpclip.exe is responsible for operating the clipboard between your computer and the Remote Desktop host. When a remote user connects to Remote Desktop, a separate rdpclip.exe process is started for each session. You can use the Task Manager to kill therdpclip.exe
(RDP Clipboard Monitor) process and start it again manually (Task Manager -> File -> Start new task -> rdpclip -> Enter).
Usually, it helps to restore the remote clipboard operation quickly. Check that copy/paste (Ctrl+C
/ Ctrl+V
) now works in the RDP session.
(Get-WmiObject -Query "select * from Win32_Process where name='RDPClip.exe'"|?{$_.GetOwner().User -eq $ENV:USERNAME}).Terminate()
rdpclip.exe
To make it easier to use the script, you can sign the PowerShell script file or configure a PowerShell Execution Policy.
Enable Clipboard in Remote Desktop Client on Windows
Check that your RDP client settings allow you to use the clipboard in the terminal session. If you are using the built-in Windows RDP client (Remote Desktop Connection, mstsc.exe
) to connect to a remote terminal host, check that its settings allow copying via the RDP clipboard.
Go to the Local Resources tab, and make sure the Clipboard option is enabled in the “Choose the devices and resources that you want to use in your remote session” section.
If you want to allow files to be copied via the RDP clipboard, click the More button and check the Drives option. This will allow the use of local drives in the RDP session for file copying tasks.
If you are using a pre-configured *.RDP file with settings to connect to a remote computer (for example, to connect to a published RemoteApp on RDS), check that the following options are configured in it:
redirectclipboard:i:1 redirectdrives:i:1 drivestoredirect:s:*
- redirectclipboard — allows using the local clipboard in a remote session;
- Drivestoredirect and redirectdrives – enable redirection of all local drives to the RDP session (required if you want to copy/paste files through RDP).
How to Enable or Disable Copy/Paste via RDP Clipboard on Windows?
You can enable or disable the use of the RDP clipboard for copy/paste operations on the Windows host through Group Policy or registry settings.
- Run the Local Group Policy Editor:
gpedit.msc
- Go to Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Device and Resource Redirection;
- To prevent copying data to/from a remote server using the clipboard of an RDP session, set the following policies to Enabled:
Do not allow Clipboard redirection – clipboard redirection is used to copy text or files using the RDP clipboard;
Do not allow drive redirection – allows the user to access their local drives in an RDP session. It is also used to copy files between a local computer and an RDP host;
When these policies are enabled, the following DWORD parameters are created in the HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services registry key:fDisableCdm
= 1 (disable local drive redirection on RDP host)
fDisableClip
= 1 (Disable clipboard between RDP server and client)There are similar policy settings in the user GPO section. This means that you can disable the use of the clipboard and the mapped drives for specific RDP users. You can disable the RDP clipboard for non-admin users on a standalone (workgroup) computer by using multiple local GPOs (MSLGO). - If you want to force the use of the RDP clipboard, change the values of the settings to Disabled (by default, RDPClipboard is allowed to be used to copy data between a local computer and a remote RDP host);
- Update the Group Policy settings using
gpupdate /force
. For new settings to be applied to users, they must end their RDP sessions (using Logoff instead of Disconnect) or wait for user sessions to be automatically disconnected according to RDS timeouts.
You can use the registry to completely disable the RDP clipboard and local drive redirection for all users on an RDP-enabled Windows host. To do this, create REG_DWORD parameters in the HKEY_LOCAL_MACHINE\Software\Microsoft\Terminal Server registry key:
- DisableClipboardRedirection = 1
- DisableDriveRedirection = 1
And the two parameters that were discussed above in the HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services registry branch:
- fDisableCdm =1
- fDisableClip = 1
To quickly disable the ability to copy data between a computer and a remote RDP host via a clipboard, run the following commands:
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
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v fDisableCdm /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v fDisableClip /t REG_DWORD /d 1 /f
If you want to allow the RDP clipboard to be used, these registry settings should be missing (by default) or set to 0
You can check the value of a registry setting using PowerShell:
Get-ItemProperty -Path 'HKLM:SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' | Select fDisableClip,fDisableCdm
If you are using RDS hosts running Windows Server 2022/2019/2016/2012R2, you can enable or disable the clipboard and the local drives redirection in the RDS collection settings. Open the Server Manager -> Remote Desktop Services -> Collections -> Tasks -> Edit Properties -> Client Settings. Uncheck Clipboard and Drives options in the Enable redirecting for the following section.
The Drives option allows you to use the clipboard to copy files (the local drives will be used in an RDS session).
You can change the RDS collection settings with PowerShell:
Set-RDSessionCollectionConfiguration -CollectionName munRDSApp1 -ClientDeviceRedirectionOptions "Clipboard,Drive"
If you are using a Remote Desktop Gateway to connect to the RDS host, note that you can disable or allow the use of the clipboard in your CAP (Connection Authorization Policy) settings. By default, the Enable device redirection for all client devices option is enabled in the Device Redirection section. Here you can disable the RDP clipboard and local drives redirection.
If you want to prevent users, but not administrators, from copying to/from an RDP session, you can change the NTFS permissions on the executable C:\windows\system32\rdpclip.exe
. To do this, uncheck the Read/Execute permissions for the built-in Users group in the file’s security properties (you will have to change the file owner from TrustedInstaller to another one first).
7 comments
Hello,
just a question (you never know), is it possible to copy text from a web page (.php) in a browser (edge, ff) then, in a “RDP” remote desktop session (and RDP in citrix too) to paste the text into PowerShell, without DOM or invisible characters?
Cordially.
hola, no me aparece en el administrador ese proceso?? que puedo hacer?
hola, pero es rdpclip no esta en ejecución, y¿y no permite copiar, pero he verificado en otro servidor que si deja copiar y pegar, y tampoco tiene ese servicio pero si deja copiar y pegar
Using the Task Manager, you can kill the rdpclip.exe (RDP Clipboard Monitor) process and run it manually (Task Manager -> File -> Start new task -> rdpclip -> Enter).
It’s working, thanks.
Working beautifully on Win 2019
Great, I had everything set up correctly except for this entry:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services registry branch:
fDisableCdm =1
(It came out to 1 and changing it to 0 has let me copy and paste)
Thank you
Just a heads-up. I found that the $ENV.USERNAME Variable doesn’t always work in RDS. Therefore, you may need to use [ENVIRONMENT]::USERNAME in it’s place.