Nếu bạn muốn dùng tính năng Remote Desktop mà không mở bảng Windows Settings, bạn có thể bật Remote Desktop bằng Command Prompt hoặc Windows PowerShell. Nếu bạn có Remote Desktop client trên điện thoại hoặc máy tính khác, bạn sẽ kết nối và dùng PC từ xa.
Remote Desktop là tiện ích nổi tiếng cho máy tính Windows 11/10 cho phép kết nối hai máy tính hoặc điện thoại để cá nhân truy cập máy tính khác từ xa. Bạn có thể sửa sự cố trên máy tính qua điện thoại hoặc làm việc khác theo yêu cầu. Bạn cần Remote Desktop client như Microsoft Remote Desktop trên điện thoại để kết nối hai thiết bị.
Có thể bật/tắt Remote Desktop qua Windows Settings. Bạn vào System > Remote Desktop để truy cập tùy chọn. Tuy nhiên, giả sử Windows Settings không mở do lý do nào, và bạn cần bật Remote Desktop. Khi đó bạn có thể dùng phương pháp này để bắt đầu Remote Desktop bằng dòng lệnh.
Bật Remote Desktop bằng dòng lệnh
Để bật Remote Desktop bằng Command Prompt và Windows PowerShell, làm theo các bước:
- Mở Command Prompt hoặc PowerShell với đặc quyền admin
- Đặt giá trị fDenyTSConnections REG DWORD thành 0
- Thêm quy tắc Firewall
- Khởi động lại máy tính
- Bắt đầu dùng Remote Desktop trong Windows 10.
Các lệnh không giống nhau cho Command Prompt và Windows PowerShell.
1. Bật RDP firewall bằng Command Prompt

Để bắt đầu, mở Command Prompt với đặc quyền admin. Bạn có thể tìm trong ô tìm kiếm Taskbar, và nhấp tùy chọn Run as administrator xuất hiện. Sau đó, nhập lệnh sau và nhấn Enter:
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
Mặc định, giá trị fDenyTSConnections được đặt là 1. Lệnh này sẽ thay đổi giá trị thành 0.
Tiếp theo, thực thi lệnh sau:
netsh advfirewall firewall set rule group="remote desktop" new enable=yes
Lệnh này sẽ thêm và cập nhật ba quy tắc trong Firewall để bạn có thể bắt đầu dùng Remote Desktop.
2. Bật RDP bằng Windows PowerShell

Bạn cần mở Windows PowerShell với đặc quyền admin và nhập lệnh sau và nhấn Enter:
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name "fDenyTSConnections" -Value 0
Lệnh này sẽ thay đổi giá trị fDenyTSConnections thành 0. Bây giờ, bạn cần thực thi lệnh sau để thêm quy tắc trong Firewall:
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
Sau đó, bạn sẽ có thể dùng Remote Desktop trong Windows 10.
Trường hợp bạn muốn tắt Remote Desktop bằng Command Prompt và Windows PowerShell, bạn cần nhập các bước sau.
Liên quan: Tùy chọn Remote Desktop bị mờ (greyed out).
Tắt Remote Desktop bằng Command Prompt hoặc PowerShell
Để tắt Remote Desktop bằng Command Prompt và Windows PowerShell, làm theo các bước:
- Mở Command Prompt hoặc PowerShell với đặc quyền admin
- Đặt giá trị fDenyTSConnections REG DWORD thành 1
- Thêm quy tắc Firewall
- Khởi động lại máy tính.
Để biết thêm, hãy đọc tiếp.
Tắt Remote Desktop bằng Command Prompt
Bạn cần đặt giá trị mặc định fDenyTSConnections là 1. Dùng lệnh:
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 1 /f
Bây giờ bạn cần xóa quy tắc khỏi Firewall. Dùng lệnh:
netsh advfirewall firewall set rule group="remote desktop" new enable=No
Tắt Remote Desktop bằng PowerShell
Bạn cần thay đổi giá trị fDenyTSConnections thành 1. Làm bằng lệnh:
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name "fDenyTSConnections" -Value 1
Lệnh thứ hai cho phép xóa quy tắc khỏi Firewall:
Disable-NetFirewallRule -DisplayGroup "Remote Desktop"
Đó là tất cả! Hy vọng hướng dẫn đơn giản này hữu ích cho bạn.
