Toggle RDP clipboard & drive redirection on the server — one click, no gpedit.msc.
Repository: github.com/shellsec/RDPClipSwitcher
Language: English | 中文
🚀 Recommended: ofox.ai
In short: One account for GPT-5.5 / Claude 4.8 Opus / Gemini 3.5 Flash and 100+ top models. First top-up gets an extra $3 credit.
👉 Sign up · Global dedicated lines · Enterprise SLA · No conversation retention
| ⚡️ Fast & Stable | 🧠 Full Model Coverage | 🛡️ Privacy |
|---|---|---|
| Global dedicated lines, enterprise SLA | 100+ models, one account | No conversation retention |
Open source takes effort — sponsorship is welcome:
👉 爱发电 / Afdian
More Windows Server / RDS utilities by shellsec:
| Project | Description |
|---|---|
| RDS_Grace_Period_Reset | Windows Server RDS grace period reset tool |
Toggle RDP clipboard and drive redirection on the server side with one click — no need to open gpedit.msc every time.
How it works: writes the equivalent GPO registry keys and runs gpupdate /force.
| Type | Versions |
|---|---|
| Windows Server | 2016, 2019, 2022, 2025 (and same-generation RDS session hosts) |
| Windows client | Windows 10, Windows 11 (Pro / Enterprise editions that accept incoming RDP) |
Where to run: on the machine being remoted into (the RDP server), with Administrator rights.
Not supported: Home editions (no inbound RDP host by default), Linux xrdp, older Server versions (2008 R2 / 2012 R2) not verified.
Script encoding: all .ps1 files are UTF-8 with BOM; UI text is English (ASCII) for compatibility with Windows PowerShell 4.0+ on GBK systems. If you see garbled Chinese / parser errors, re-download the latest scripts from GitHub.
| File | Description |
|---|---|
RDPClipSwitcher.ps1 |
Interactive menu (enable / disable / status) |
RDPClipSwitcher-Lib.ps1 |
Shared helper (Restart-RdpClip) |
Run-RDPClipSwitcher.bat |
Double-click to launch menu with elevation |
Restart-RdpClip.ps1 |
Restart rdpclip.exe only (no policy change) |
Enable-RdpClipboard.ps1 |
Allow clipboard redirection |
Disable-RdpClipboard.ps1 |
Block clipboard redirection |
Enable-RdpDriveRedirection.ps1 |
Allow drive redirection (file channel) |
Disable-RdpDriveRedirection.ps1 |
Block drive redirection |
Recommended path (standard deployment):
C:\Program Files\RDPClipSwitcher
Alternative (testing / frequent edits, no spaces in path):
C:\Tools\RDPClipSwitcher
First-time setup on the RDP server (elevated PowerShell):
$dest = "${env:ProgramFiles}\RDPClipSwitcher"
New-Item -ItemType Directory -Path $dest -Force
git clone https://github.com/shellsec/RDPClipSwitcher.git $dest
Set-ExecutionPolicy Bypass -Scope Process -Force
& "$dest\RDPClipSwitcher.ps1"Or download a zip from Releases and extract the entire folder (including RDPClipSwitcher-Lib.ps1) to $dest.
Daily use: double-click Run-RDPClipSwitcher.bat in that folder.
| Note | Detail |
|---|---|
| Updates | Writing to Program Files requires Administrator |
| Path with spaces | Always quote: & "C:\Program Files\RDPClipSwitcher\RDPClipSwitcher.ps1" |
| Do not copy single files | Keep all scripts in the same directory |
git clone https://github.com/shellsec/RDPClipSwitcher.git "${env:ProgramFiles}\RDPClipSwitcher"
cd "${env:ProgramFiles}\RDPClipSwitcher"Or download a zip from Releases and extract to the install path above.
- Install to
C:\Program Files\RDPClipSwitcher(see Installation). - Double-click
Run-RDPClipSwitcher.bat(requests admin elevation). - Follow the menu.
Or in an elevated PowerShell:
Set-ExecutionPolicy Bypass -Scope Process -Force
& ".\RDPClipSwitcher.ps1"Menu:
Quick (clipboard + drives together):
1) Allow ALL (text copy/paste + files)
2) Block ALL (text copy/paste + files)
Clipboard only (text):
3) Allow clipboard
4) Block clipboard
Drive only (files):
5) Allow drives
6) Block drives
7) Show current status
8) Restart rdpclip.exe only
0) Exit
Note: Clipboard (fDisableClip) and drive (fDisableCdm) are separate Windows policies. Use 1 / 2 to change both at once. Options 3–6 change one channel only.
Right-click Start → Windows PowerShell (Admin), then run:
Set-ExecutionPolicy Bypass -Scope Process -Force
# Allow clipboard
& ".\Enable-RdpClipboard.ps1"
# Block clipboard
& ".\Disable-RdpClipboard.ps1"
# Allow drives
& ".\Enable-RdpDriveRedirection.ps1"
# Block drives
& ".\Disable-RdpDriveRedirection.ps1"GPO path:
Computer Configuration
→ Administrative Templates
→ Windows Components
→ Remote Desktop Services
→ Remote Desktop Session Host
→ Device and Resource Redirection
→ Do not allow clipboard redirection
→ Do not allow drive redirection
Registry:
| Value name | Path | Meaning |
|---|---|---|
fDisableClip |
HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services |
1 = block clipboard; 0 / missing = allow |
fDisableCdm |
same as above | 1 = block drives; 0 / missing = allow |
fDisableClip (override) |
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp |
if set to 1, clipboard is also blocked |
When allowing clipboard, scripts set the GPO key to 0 and clear any hard override on RDP-Tcp.
- Script completes successfully on the server as Administrator.
- Clipboard changes automatically restart
rdpclip.exe(kill all instances, start in the current session). - If clipboard still fails, disconnect and reconnect RDP. On multi-user RDS, other sessions may need reconnect.
- In rare cases, restart the
TermServiceservice; usually not required.
Usually this is drive redirection, not clipboard policy:
- Server: run
Enable-RdpDriveRedirection.ps1, or menu option5. - Client: in
mstsc→ Show Options → Local Resources → More → check local drives.
GPO only controls server-side allowance; whether the client redirects drives is chosen at connect time.
Elevated PowerShell:
Get-ItemProperty "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" -ErrorAction SilentlyContinue |
Select-Object fDisableClip, fDisableCdm
Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -ErrorAction SilentlyContinue |
Select-Object fDisableClipOr use menu option 7 for a summary of GPO keys, RDP-Tcp override, and effective result.
- Changes local (or per-computer) policy registry only; does not edit domain GPO templates in the console. If domain policy overrides with higher precedence, coordinate with your domain admin.
- In production, use option
7to inspect current state before changing anything. - Blocking clipboard can reduce data exfiltration risk; ensure policy compliance before enabling redirection.