Prevent sleep for RDP client

Abstract: Resolve RDP disconnections caused by Windows entering sleep mode during remote sessions.

Created: 2026-09-03 by
To prevent your Windows computer from entering sleep mode while you are connected via Remote Desktop Protocol (RDP), you must adjust the power settings on the host machine. By default, Windows may hibernate or sleep after a period of inactivity, which terminates your remote session and disconnects you from the server. You can resolve this by modifying the Advanced Power Settings to ensure the system remains awake when an RDP session is active, ensuring uninterrupted access to your remote resources.

Understanding the Default Behavior

Windows operating systems are designed to conserve energy by entering sleep or hibernation states after a specified period of inactivity. When you connect to a machine using Remote Desktop, the host computer still monitors its own idle timers. If no local input (mouse or keyboard) is detected for a set duration, the OS will trigger a sleep event. This action suspends the system state, effectively cutting off all network connections, including your RDP session. For users managing servers or long-running tasks remotely, this automatic behavior is often undesirable.

If you frequently encounter disconnections during critical operations, it is important to distinguish between "Sleep" and "Hibernate." Sleep keeps data in RAM and uses minimal power, allowing for quick resume times. Hibernate writes the system state to the hard drive and powers down completely, requiring a longer boot time. Both states will terminate an active RDP connection, so preventing either is necessary for continuous availability.

Adjusting Power Plan Settings

The most direct way to keep your computer awake is to modify the active Power Plan. This method applies to both client and host machines running Windows 10 or Windows 11. You need to change the settings that control when the display turns off and when the computer enters sleep.

  1. Open Control Panel: Press Win + R, type control, and press Enter. Alternatively, search for "Control Panel" in the Start menu.
  2. Navigate to Power Options: In the Control Panel, go to Hardware and Sound > Power Options. Ensure you are viewing the current plan by checking the radio button next to your active power scheme (e.g., Balanced or High Performance).
  3. Access Advanced Settings: Click the link labeled Change plan settings next to your selected plan. On the next screen, click Change advanced power settings.
  4. Modify Sleep Settings: In the Power Options dialog box, expand the Sleep category. Look for Sleep after. Change the setting for "On battery" and "Plugged in" to Never. Note that on desktops, "On battery" may not apply, but it is good practice to set "Plugged in" to Never.
  5. Save Changes: Click Apply and then OK to save your configuration.

This adjustment ensures that the timer responsible for initiating sleep will never expire. However, be aware that setting sleep to "Never" means your computer will remain fully powered on indefinitely, which increases electricity consumption and wear on hardware components like fans and drives. It is crucial to balance convenience with energy efficiency.

Using Command Line Tools for Precision

For users who prefer command-line interfaces or need to script these changes across multiple machines, the powershell tool provides robust options. You can query the current sleep settings using the powercfg utility. To disable sleep entirely via command line, you can execute specific commands to modify the GUID identifiers associated with the sleep state.

powercfg -setactive scheme_current
powercfg -change -monitor-timeout-ac 0
powercfg -change -standby-timeout-ac 0

In the commands above, 0 represents "Never." The -ac suffix indicates "Alternating Current," meaning these settings apply only when the computer is plugged into power. If you also want to prevent sleep on battery power (for laptops), replace -ac with -dc (Direct Current). This method is particularly useful for administrators managing a fleet of devices where GUI interaction is inefficient.

Preventing Display Timeout vs. System Sleep

A common point of confusion is the difference between turning off the display and putting the computer to sleep. Turning off the monitor does not stop the CPU or network stack; it merely blanks the screen. Your RDP session will continue to run even if the physical monitor is off. However, if you want to ensure the system does not sleep, you must adjust the Sleep after setting, not just the Turn off display after setting.

You can leave the display timeout at a reasonable interval (e.g., 15 minutes) to save energy on the screen while keeping the system awake. This is often the best compromise for office environments. To do this, return to the Advanced power settings menu, expand Display, and set Turn off the display after to your preferred time, while keeping Sleep after as Never.

Related Issues and Considerations

While adjusting power settings solves the immediate problem of disconnection, there are other factors that might affect your remote experience. For instance, if you are experiencing black screens upon connecting, check our guide on fixing black screen issues in Windows 10 Pro RDC. Additionally, if you need to send special keys like CTRL-ALT-DEL to a second-hop remote desktop, refer to our article on sending CTRL-ALT-DEL to secondary remote desktops.

Another consideration is wake scheduling. If you have disabled sleep but need the machine to wake up automatically for scheduled tasks, ensure that Wake Timers are enabled in the same Advanced Power Settings menu under Sleep > Allow wake timers. This prevents scenarios where the machine is asleep due to a previous state and cannot receive incoming connections until manually woken. For more details on managing wake events, see our resource on Windows scheduling wake to work.

Finally, if you notice slow connecting times after changing these settings, it may be unrelated to sleep states. Network latency or DNS resolution issues often cause delays. Consult our troubleshooting guide for slow connecting times in Windows 10 RDC if performance degrades after your power adjustments.

Frequently Asked Questions

Will disabling sleep increase my electricity bill?

Yes, keeping a computer awake prevents it from entering low-power states, which increases energy consumption. Desktops typically use significantly more power than laptops in sleep mode. It is recommended to enable "High Performance" plans only when necessary and revert to "Balanced" when remote access is not required.

How do I prevent sleep only for certain applications?

Windows does not natively support application-specific sleep prevention. You must rely on global power settings. However, some third-party utilities like "Insomnia" or "Caffeine" can simulate user activity to keep the system awake temporarily without changing system-wide power plans.

Does turning off the display affect my RDP session?

No, turning off the display monitor does not interrupt the RDP session. The network connection remains active, and background processes continue to run. You can safely set the display timeout to a short duration to save screen energy while keeping the system awake.

What happens if I set sleep to Never on a laptop?

The laptop battery will drain quickly if left unplugged. Always ensure the laptop is connected to AC power before setting sleep to Never. If you must work on battery, consider setting a moderate sleep timeout (e.g., 30 minutes) to preserve battery life while maintaining reasonable uptime.

Can I use Group Policy to enforce these settings?

Yes, domain administrators can use Group Policy Objects (GPO) to force power settings across all domain-joined computers. Navigate to Computer Configuration > Policies > Administrative Templates > System > Power Management in the GPO editor to configure sleep timeouts centrally.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More