WinSleep - Frequently Asked Questions
	- Updated June 16, 2024 for Version 1.6.6.0.

What will WinSleep do for me?
	- Keeps your desktop computer asleep (while not too busy) as much as possible during periods you specify.
	- Provides a detailed timeline graph showing when your computer was awake, asleep, or hibernating.
	- Saves money!  A typical desktop uses 200 watts of electricity when awake, but only a few watts while asleep.  Power companies (in the US) bill at an average of 18 cents/kWH.  This is .2 kWH @ 18 cents (U.S. average electricity cost) = 3.6 cents/hour you are saving while asleep. Say WinSleep sleeps your computer for half the day; this is $.43/day = $158/year.  The more you sleep, the more you save.  See https://www.globalpetrolprices.com/electricity_prices/ for typical electricity prices by country.  In Denmark, your savings would be about $500/year!
	- Provides convenient Sleep and Hibernate buttons for manual use when desired.
	- Shows the current CPU/Disk/Network usage percentages for your computer.
	- Wake the computer at specified times using wake schedules.
	- Designate other programs on your computer as "Stay Awake Programs" to prevent sleep while these are running or too busy.
	- Helps prolong the life of your desktop computer.  Your disk drive is not spinning, motherboard is not powered, fan is not running (and accumulating dust inside the computer casing), and your monitors are in standby mode.
	- Stay in touch with WinSleep when you are away from home!  The free program WinSleep Monitor can be installed on a remote computer to see when your home computer was awake or asleep, or to sleep/hibernate/wake it remotely.  See www.molliesoft.com/WinSleepMonitor for more information.

How do I install WinSleep?
	- Go to www.molliesoft.com/WinSleep to download the install package.  You will need administrator privileges on your machine to perform the install.

What operating systems will run WinSleep?
	- WinSleep runs on Windows 7, Windows 8.1, Windows 10 or Windows 11.
	- WinSleep requires the .NET Framework version 4.6.1 to run.  This should normally already be present; if the WinSleep installation process detects it is not installed, go to https://www.microsoft.com/en-us/download/details.aspx?id=49982 and install it.

How do I run WinSleep?
	- The install process will place a shortcut to WinSleep in your Startup folder, so it will start when you log on to your computer.
	- WinSleep should always be kept running so that it can automatically put your machine to sleep when idle, and so that it can record and graph waking and sleeping periods; just minimize it to the system tray instead of closing WinSleep.
	- The install process also places a shortcut to WinSleep on your desktop, so that you can start WinSleep manually.

What kind of computer will benefit from running WinSleep?
	- WinSleep is primarily designed to prevent wear-and-tear on desktop computers.
	- Laptops typically do not need WinSleep since the user just closes the cover when done with it, which is usually configured to put the laptop to sleep.
	- You should NOT install WinSleep on laptops using "Modern Standby" (a new instant-on state) since on such machines there is no real sleep state, just a low power state that resembles sleep.  Also, the Sleep button will hibernate instead of sleeping; such machines generally use a Solid-State drive (SSD), and writing large amounts of data to a hibernation file would reduce the lifespan of the SSD.  In general, you should not use hibernate on any machine whose Windows drive is an SSD.
	- On startup WinSleep will verify that at least one of the normal sleep states (S1, S2 or S3) are available.  These are NOT available on "Modern Standby" laptops (which use the "S0 Low Power Idle" sleep state), so a warning dialog is displayed allowing you to exit WinSleep or accept the risk and limitations, and continue running WinSleep.

I clicked the "Minimize" button (on the upper right of WinSleep); where did it go?  
	- When minimized, the WinSleep icon will appear in the System Tray (normally at the bottom right of the desktop).  If you do not see it there, click the small up-arrow in the tray marked "Show Hidden Icons".  Note that Windows lets you customize the System Tray to make the WinSleep icon stay in the visible portion of the tray if desired.  You can also use the WinSleep desktop shortcut to make WinSleep appear on the screen again.
	- The WinSleep icon in the system tray will turn blue (instead of the normal orange) to indicate a sleep policy is currently in effect.

What will happen to WinSleep when the trial period expires?
	- After the 30-day trial period, WinSleep will start but only allow you to purchase a license if desired.  Without a license, WinSleep will no longer run as before.  A license entitles you to run WinSleep permanently on a single computer.

If I upgrade to the next version of WinSleep, will my permanent license still be valid?
	- Yes.  A permanent license for WinSleep is a license forever; you can safely upgrade to any new version and your license will still be valid.  The same is true of a trial license within the 30-day trial period.

How can I learn more about how WinSleep works?
	- This FAQ is the main source of information about WinSleep.
	- While running WinSleep, built-in help is available for the Sleep Journal, Sleep Schedules, Wake Schedules, Stay Awake Programs and System Information Capture windows.  Each of these has a "Show help" checkbox in the top row of controls; turn this option on to see a help panel customized to each of these windows.

WinSleep Configuration (Sleep Schedules, Sleep Policies, Wake Schedules)

What is a Sleep Policy?
	- A Sleep Policy measures if the computer is "busy" by defining usage limits that control when the computer will sleep (or hibernate).  These include upper limits for CPU, Disk, or Network activity percentages, and lower limits for User Idle time or System awake time.

How can I tell if the Sleep Policy limits are appropriate for my computer?
	- The System Information table at the top left of WinSleep show current CPU/Disk/Network usage percentages.  When a Sleep Policy is in effect, the limits are shown in the column to the right of the current usage data, and the left-hand current usage percentages are colored green if under the limit, red if over the limit, and are shaded closer to red as they approach the limit.  The colors provide visual indications of how close the actual usage gets to the usage limit defined in the active Sleep Policy.
	- Press the System Information button above the table to display the System Information Capture View.  This will allow you to capture the values of system information usage percentages over time, and will help you determine if the sleep policy usage limits are appropriate.  See the section "System Information Capture" below for more information.

What is a Sleep Schedule?
	- WinSleep uses Sleep Schedules to specify a time period (e.g. 20:00 - 07:00) during which a Sleep Policy will be in effect (enabled).  For international compatibility, WinSleep uses a 24-hour clock throughout.
	- Sleep Schedules can be specified as Daily (a certain time period every day), Weekly (a time period for certain days of the week), or Monthly (a time period for certain days of the month).
	-  A single Sleep Policy is assigned to each Sleep Schedule, but different Sleep Schedules can use the same Sleep Policy if desired.

How do I configure WinSleep for my computer?
	- Press the Sleep Schedules button to configure your Sleep Schedules and Sleep Policies.  This shows the Sleep Schedules window.
	- To change the properties of a Sleep Schedule, click on a particular schedule (if you have more than one), then change the settings at the bottom left of the window. (Note that you cannot change the settings directly in the schedules list, except for the Enabled and Wake at end checkboxes.)
	- To change the properties of a Sleep Policy, change the percentages shown in the Sleep policy area at the bottom right of the window.  You can add, remove or rename policies by using the Add/Remove/Rename buttons in this area.  Note there must always be exactly one Sleep Policy named "Default"; it cannot be removed, but you can change the settings for the Default policy.
	- If you have added additional custom sleep policies, you can select which policy is attached to a particular Sleep Schedule by selecting the Sleep Schedule, then changing the name of the Sleep Policy for that schedule in the Sleep Policy area.
	- You can assign the same Sleep Policy (e.g. Default) to multiple schedules; for example, you can define one Daily schedule for 9:00 - 17:00, and another Daily schedule for 23:00 - 06:00, with both using the Default Sleep Policy; or you can create a different Sleep Policy to be used by one of the schedules.
	- Sleep Policy names must be unique, are case insensitive, and can only contain the letters a-z/A-Z, digits 0-9, underscores (_), and dashes (-).  Thus you cannot create a policy named "default" in addition to "Default".

I just want my computer to stay asleep all night!  How can I do this?
	- Create a daily sleep schedule that starts at 10 p.m. and ends at 6 a.m., then select the pre-defined sleep policy "Always Sleep" for this schedule.  Your computer will go to sleep at 10 p.m. and will stay asleep until 6 a.m., unless you wake it up using the mouse, keyboard or power button (or Windows wakes it).
	- If awakened during this time, it will start the sleep countdown after 2 minutes (this is the idle time specified in "Always Sleep, which you can change:).  The countdown period lasts 10 seconds by default, but you can change the countdown delay in Settings.
	- Note: If Windows continually wakes your computer, the most likely cause is an incomplete Windows Update.  To keep your computer asleep, make sure you have completed any pending Windows Updates.
	- Note: If your computer is sleeping and Windows wakes it to perform a Windows Update, Windows can put it back to sleep EVEN IF no WinSleep sleep schedule is in effect.  This is just normal Windows behavior and running WinSleep does not change this.
	- You can temporarily countermand the "Always Sleep" sleep policy by using the Stay Awake button to force the computer to stay awake for a specific time period.
	- There is nothing special about the "Always Sleep" policy.  You can remove it if you do not intend to use it.  You can re-add it (or an equivalent sleep policy) by specifying the limits:
	CPU % = 100, Disk % = 100, Network % = 100,
	User Idle Time = 0, System Awake Time = 2 minutes.
This policy will (almost) always be satisfied since the machine usage is always within these limits.  Note that System Awake Time in a sleep policy is always 2 minutes or more to give you some time to countermand immediate sleep when the computer wakes.

What if I have a sleep setting defined in the Windows control panel?
	- It is recommended you just let WinSleep control this, since it offers finer control over when sleep occurs.  However if you do sleep the computer using the start menu (under "Shut down or sign out"), or let Windows sleep the computer automatically, WinSleep will keep a record of these periods for you as well.

What happens if two Sleep Schedules have time ranges that overlap?
	- If more than one Sleep Schedule is in effect at a particular time, only the first one listed in the Sleep Schedules table will be considered in deciding whether or not to put the computer to sleep.  If there is an active Sleep Schedule, its Sleep Policy name is shown above the System Information table.
	- All the sleep policies in effect are shown in the main window title bar, and will appear in red with a leading * in the Sleep Schedules window.  However, since only the first such policy is the active policy, only the first is shown next to the System Information button on the main window.

What should I do if WinSleep is putting my computer to sleep too often?
	- If you just want the computer to stay on for a while, use the Stay Awake button.  You can pick a Stay Awake time period between 10 minutes and 1 day.  When the time period is over, the currently active sleep schedule will resume, if there is one. To cancel the Stay Awake period, just press Resume Schedules.
	- To change sleep behavior permanently, change the limits in the Sleep Policy associated with the current schedule.  To sleep the computer less often, lower the CPU, Disk, or Network activity limits so the machine will usually be above these limits; raise the user idle time or system awake time limits so the machine will usually be below these limits.

Why do I see the bright green "Stay Awake" periods in the graph when no one actually pushed the "Stay Awake" button?
	- When the computer is preparing to sleep (shows "Sleeping in 10 seconds" countdown dialog), the user may cancel the scheduled sleep.  In this case, to prevent the computer from cycling too rapidly between sleep and awake, a 10-minute "Stay Awake" period is automatically generated to prevent another attempted sleep until the Stay Awake period is over.

What happens if the computer becomes busy again while the "Sleep Countdown" window is shown?
	- Normally, nothing happens; the Sleep Countdown continues and sleep will occur when the countdown gets to zero.  However, if you want to make Sleep Countdown cancel automatically when the usage limits for your current sleep policy are exceeded, open the Settings dialog, and check the "Cancel Sleep Countdown if busy" box.
	- You can set the Sleep Countdown delay to anything from zero to one hour. Note that if you set a longer Sleep Countdown delay, and you have checked "Cancel Sleep Countdown if busy", you are making it correspondingly harder for the computer to actually sleep, since the usage limits must be satisfied for the entire time the Sleep Countdown window is shown.  For example, if you move the mouse during the Sleep Countdown period, the User Idle Time limit may be exceeded, and the Sleep Countdown will be cancelled.

How can I tell which (if any) Sleep Policy is currently in effect?
	- The currently active sleep policy name is shown above the System Information table.  (Only one sleep policy can be active at a time, although many may be "in effect".)
	- In the Sleep Schedules window, any sleep policy currently in effect will have a name colored in red, with an asterisk preceding its name.  The first such sleep schedule in effect in the list is the active sleep policy.
	- The WinSleep main window title bar shows which policies are currently in effect.
	- If you have configured the bar graph to show sleep policies, you can hover the mouse on any bar to see a popup hint indicating which policy is in effect for that time frame.

How can I make the computer wake at a specific time?
	- You can check "Wake at end" for any Sleep Schedule to wake the computer at the end time of that schedule. (It does not matter how the computer was put to sleep.)
	- You can create any number of independent Wake Schedules to wake the computer at a certain time (daily, monthly, or weekly), and run an optional task at that time.  (The task will run regardless of whether the wake schedule actually had to wake the computer.) The "Wake Schedules" button in the main window allows you to add, remove, or change the timing of your existing Wake Schedules.  Wake Schedules operate independently of any Sleep Schedule.
	- The "Next wake" field in the upper-right area of the main window always shows the next calculated date and time at which the computer will wake as set by WinSleep.  This is the earliest future time of all your existing wake schedules, or the end time of any sleep schedule with "Wake at end" checked.  Note your computer may wake based on system wake timers set by other programs or by Windows itself.  To see all existing system wake timers, open the Wake Schedules view and click the "Show wake timers" checkbox.
	- Optionally, you can run a task at a scheduled wake time:
•	The "Target" of the task can be any executable program (exe, cmd, bat, etc.), which will be passed the "Program Arguments" when run; or the "Target" can be any document (.txt, .doc, etc) which will be opened using the default Windows open handler for that file type.
•	If the computer is asleep, the Wake Schedule will wake the computer, then run the task immediately; if the computer is already awake at the Wake Schedule time, the task will be run at the scheduled time regardless.
•	If the task opens a desktop window, the "Start Minimized" checkbox (if checked) will start the task as a minimized window.
•	If the task requires the computer to stay awake for a certain period to ensure adequate time for completion, you can specify a "Stay Awake" period (hours:minutes) to apply after the wake event.  WinSleep will not sleep or hibernate the computer until this period has expired.  You can set a Stay Awake period for the wake schedule even if there is no associated task; this is useful if the task is launched by some mechanism other than WinSleep.
•	To test the configuration of your task, press the "Run now" button and observe the result.  When the task is run (from the Wake Schedule or the "Run now" button), a successful or unsuccessful launch is noted as a WinSleep history log entry.
•	When a task is run (either via the schedule or the "Run Now" button), the last run time is recorded and shown with the task information.
•	A task can be enabled or disabled, independently of whether the Wake Schedule is enabled or disabled.  A task will only be run at the scheduled time if the Wake Schedule is enabled, AND the task is enabled.
	- Note: All wake settings in WinSleep depend on the Windows mechanism of "Waitable Timers", which may or not work depending on your machine's individual BIOS.  Some experimentation with your computers settings may be required to get it to work. Also, for some computers (especially laptops) you may need to configure the Power Options Advanced settings to allow wake timers if this is not already allowed.  See http://www.tenforums.com/tutorials/63070-wake-timers-enable-disable-windows-10-a.html.
	- You can show all the current Windows wake timers (set by any program, not just WinSleep): Cllick the "Wake Schedules" button on the main window, check "Show wake timers" at the top of the Wake Schedules window to make the "System wake timers" panel visible at the bottom of the window, then click the green "Get wake timers" button.  Grant admin privileges to see the current system wake timers.

Stay Awake Programs

I have an important program running!  How do I tell WinSleep not to sleep in this case?
	- You can designate any program running on your computer as a "Stay Awake Program".  While any of these programs are running (or are too busy) the active sleep policy will not put your machine to sleep.  Click the "Stay Awake Programs" button on the main window to add a stay awake program or to monitor these programs.

	- A stay awake program can be set to prevent sleep if the program is running, or if the program is too "busy" (computer usage of the program is over certain limits).
The computer usage of a stay awake program consists of two measurements:
•	% Processor Time = the amount of CPU time the program is using (0% - 100%)
•	IO Data Bytes/sec = # bytes/sec the program is reading or writing.
Each stay awake program can set upper limits for each of these measurements, above which the program is considered "busy".

	- Note: These are measured using the Windows "performance counters" of the same name.  Performance counters are part of the Windows OS and provide a means of measuring certain performance aspects of running programs.  For reference, here are the formal definitions of these two counters:
•	% Processor Time: The percentage of time the processor was busy servicing a specific process.
•	IO Data Bytes/sec: Shows the rate at which the process is reading and writing bytes in I/O operations. This counter counts all I/O activity generated by the process including file, network and device I/O's.

	- Each stay awake program has a "Stay awake if" mode that is one of:
•	Program running - The active sleep policy will not put the computer to sleep as long as this program is running.
•	Max values over limit - Sleep will be prevented if either "% Processor Time" or "IO Data Bytes/sec" exceeds its limit at any time over a specified sample time window (you can set the duration of the sample window for each stay awake program to be from 20 seconds to 1 hour).
•	Average values over limit - Sleep will be prevented if the average value (over the sample window) of either "% Processor Time" or "IO Data Bytes/sec" exceeds its respective limit.

	- Click the Add button above the list to add a new stay awake program.  This will display a list of the currently running programs on your computer.  Note that each program (e.g. notepad) may have more than one running instance; then "Program running" means at least one instance is running, and "Max values over limit" or "Average values over limit" means at least one instance of the program has values over the limit.  Initially a new stay awake program will be set to prevent sleep if the program is simply running.  You can change this to any of the other modes using the properties area below the list.
	- Click the Remove button above the list to remove the current stay awake program.  Use the Move Up and Move Down buttons to change the relative position of the current stay awake program in the list. (The position of a stay awake program in the list affects only the display order, and has no effect on functionality.)
	- You can enable or disable any stay awake program.  A disabled stay awake program will not prevent sleep, but its settings are retained and you can easily reenable it.
	- Stay awake programs that are currently preventing sleep are shown in the list with a red name.  Any of the two usage values that are over the limit will appear with a red background, whereas any usage values under the limit will appear with a green background.  Of course, if the stay awake mode is just "Program running", the usages, limits and sample interval are not used and so are not shown.  In any case, if the stay awake program is disabled the current usage values are not used and are not shown.
	- When a sleep policy is active, and there is at least one stay awake program preventing sleep, the "Stay Awake Programs" button on the WinSleep main window is red.  Hover the mouse over this button to see which programs are preventing sleep.
	- While a stay awake program is preventing sleep, you will see a light red "Stay Awake" segment on the timeline graph corresponding to this time period.
	- You can log when a stay awake program is (or is no longer) preventing sleep using the "Log history" checkbox at the top of the Stay Awake Programs window.

How do I determine the "correct" values for a Stay Awake Program's usage limits?
	- You can capture the usage values for % Processor Time and IO Data Bytes/sec over time for any Stay Awake Program.  This will help you set the corresponding limits so the computer will stay awake when these usage values are above the limits.  Capture is only possible if the Stay Awake Program is enabled and its stay awake mode is not "Program Running".  You can capture while no instance of the stay awake program is running, but of course the usage values will both be zero in this case.
	- Start the capture using the blue Capture button at the bottom left of the window, or click the Capture checkbox in the list.  When capturing, the Capture button is disabled, the red Stop button is enabled, and the elapsed time of the capture appears in blue below these buttons.  When you press the Stop button, the current live capture will be terminated and will be displayed on the usage graph.
	- While capturing, you will see the live (real-time) capture graph.  You can uncheck the "Live" checkbox above the graph if you wish to examine previous capture runs even though a live capture is in progress.  Just check "Live" again to resume monitoring the live capture.
	- Use the Zoom checkbox above the graph to magnify an area of the graph.  When Zoom is checked, you can left-click and drag on the graph to examine an area of the graph more closely.
	- You can show a completed capture run on the graph by choosing "Select run" from the drop-down list.  This will allow you to select a run by its start date from the drop-down list to the right. The duration of each run is also shown in parenthesis in the drop-down list entries (e.g. in the drop-down list, "2022/11/13 07:10 (5:23)" is the run started November 13, 2022 at 7:10 a.m., having a duration of 5 minutes and 23 seconds).
	- Instead of displaying an individual run, you can show all the runs on a particular date by choosing "Select day" from the drop-down list (instead of "Select run").  This will allow you to select a date from the calendar control that will appear on the right.  All runs (or portions of runs) that occurred on that day will be displayed on the usage graph.
	- The graph shows only one usage type at a time (% Processor Time or IO Data Bytes/sec).  You can select which of these to view using the drop-down list above the graph.
	- The usage limits in effect during the run are shown as horizontal red lines superimposed on the capture graph.  You can change these usage limits at any time (even while a capture is in progress) and this change will be visible on the graph.  This helps you to determine when a usage limit value would have caused the computer to stay awake (namely, when the graph values are above the limit line).  In this way, you can optimize the stay awake program usage limits so that your machine will stay awake when the stay awake program is "too busy".

How do I remove Stay Awake Program capture runs I no longer need?
	- WinSleep saves each stay awake program capture run on disk as 2 separate files (one each for % Processor Time and IO Data Bytes/sec).  You can remove runs you no longer need using the Remove Runs button, which shows the Remove Capture Runs dialog.  Select runs to remove (you will see the start/end times, duration, and the number of data points captured in each run).  You can sort the runs list by clicking on any of the column headers.  Before clicking the OK button in the dialog, you can check "Remove all matching capture runs with the same start time" to also remove other runs (% Processor Time or IO Data Bytes/sec) with the same start time as the selected run.

System Information Capture

How do I determine the "correct" values for CPU/Disk/Network % limits in a sleep policy, so the computer will not sleep while doing useful work?
	-The System Information Capture window lets you capture the usage values for CPU %, Disk % and Network % over time.  This will help you set sleep policy limits so the computer will only sleep when these usage values are below the policy limits.
	- Start the capture using the blue Capture button at the top of the window.  When capturing, the Capture button is disabled and the red Stop button is enabled.  When you press the Stop button, the current live capture will be terminated and will be displayed on the usage graph.
	- While capturing, you will see the live (real-time) capture graph.  You can uncheck the "Live" checkbox above the graph if you wish to examine previous capture runs even though a live capture is in progress.  Just check "Live" again to resume monitoring the live capture.
	- Use the Zoom checkbox to magnify an area of the graph.  When Zoom is checked, you can left-click and drag on the graph to examine an area of the graph more closely.
	- You can show individual runs on the graph by choosing "Select run"  from the drop-down list.  This will allow you to select a run by its start date from the drop-down list to the right.  The duration of each run is also shown in parenthesis in the drop-down list entries (e.g. in the drop-down list, "2022/11/13 07:10 (5:23)" is the run started November 13, 2022 at 7:10 a.m., having a duration of 5 minutes and 23 seconds).
	- Instead of displaying an individual run, you can show all the runs on a particular date by choosing "Select day" from the drop-down list (instead of "Select run").  This will allow you to select a date from the calendar control that will appear on the right.  All runs (or portions of runs) that occurred on that day will be displayed on the usage graph.
	- The graph shows only one System Information value at a time (CPU, Disk, or Network %).  You can select which of these to view using the drop-down list above the graph.

How do I know if the limits in a sleep policy are "reasonable"?
	- Select a sleep policy to see the policy limits for CPU %, Disk % and Network % superimposed (as a red horizontal line) on the corresponding usage graph.  As you change these limits, the corresponding limit line on the usage graph will adjust to match.  This helps you to determine when a usage limit value would have caused the computer to sleep when using this sleep policy (namely, when the graph values are below the limit line).  In this way, you can optimize sleep policy limits so that your machine will only sleep when not "too busy".  Changes made here to the sleep policy limits apply to the actual sleep policy, so you will see the same changes made in the Sleep Schedules window if it is visible and displaying a sleep schedule using this sleep policy.

How do I remove System Information capture runs I no longer need?
	- WinSleep saves each System Information capture run on disk as 3 separate files (one each for CPU/Disk/Network %).  You can remove runs you no longer need using the Remove Runs button, which shows the Remove Capture Runs dialog.  Select runs to remove (you will see the start/end times, duration, and the number of data points captured in each run).  You can sort the list by clicking on any of the column headers.  Before clicking the OK button in the dialog, you can check "Remove all matching capture runs with the same start time" to also remove each run (CPU/Disk/Network %) with the same start time as the selected run.

Timeline Bar Graph

What does the timeline graph on the main window show?
	- The Power State bar (bottom bar) shows the time periods in each day during which the computer was awake, sleeping, or hibernating.  As the legend above the graph indicates, awake periods are shown in dark green, sleep periods in tan, and hibernating periods in red.  In addition, if WinSleep was not running during a period, the Power State bar is colored grey (unknown).  Remember, you need to run WinSleep all the time in order to have an accurate record of the power state over time.
	- The Sleep Policy bars (on top of the Power State bar) show the time periods during which a particular Sleep Policy was in effect.  You can show the single "Combined" bar for all the sleep policies (recommended), or if desired show individual bars for each sleep policy you select.  Click the Graph settings checkbox (above the graph on the right) to see available options.
	- The Combined bar also shows the "Stay Awake" periods in effect in bright green.  You can also graph Stay Awake periods as a separate bar on the graph if desired.  Stay Awake periods show the time periods when you have forced the computer to stay awake using the "Stay Awake" button on the main window, or when one or more Stay Awake Programs are preventing sleep.

How many days are shown in the bar graph?
	- You can show data for the last 1-10 days by changing the "# Days" control above the graph.  This is persistent (saved when WinSleep ends) as are most graph settings.

How can I see graph data for days earlier than 10 days ago?
	- The "Live" checkbox indicates the graph is displaying real-time data.  If you uncheck this, you can then use the adjacent calendar control to select a starting date for the graph, and can select the number of days (starting from this date) to show on the graph.  The graph background is colored gray to indicate no live updates will occur (e.g. extending the Awake bar as time goes on).

How do I zoom into the graph?
	- Check the "Zoom" checkbox above the graph. The graph background is colored light brown to indicate Zoom is in effect.  Now you can use the mouse (left click, drag, and release) to select a rectangular area on the graph to examine more closely.  Left-click and drag again to zoom in further.
	- To zoom out when zoomed, use the small circular buttons on top of the graph vertical scroll bar, or at the left of the graph horizontal scroll bar.
	- When zoomed, Live mode is disabled, and the graph will not automatically update.
	- The graph background color indicates whether you are in Live mode, and whether you are zoomed.  Normally the graph background is white (live); if you uncheck live, the graph background is gray; if you zoom, the graph background is light brown.

How can I configure the timeline graph to show different types of bars?
	- The Graph settings panel controls which type of bars appear on the graph.  Click the Graph settings checkbox above the graph to make these controls appear.
	- At first, the graph will show only the standard graph settings, meaning:
•	the legend is visible,
•	the Power State bar is visible,
•	and the Combined Policies bar is visible.
The Standard graph settings checkbox appears as checked when these are showing, and no other bar options are checked.
	- You can show a different set of bars:
•	Check the Stay Awake bar checkbox to see the bright green Stay Awake periods (and the pink Stay Awake Programs periods) on a separate bar of the graph (above the combined bar).
•	Check the Default sleep policy bar checkbox to see the Default policy bar above the combined bar.
•	Uncheck the Combined policies bar checkbox if you just want to see other bars, e.g. only the Default policy bar.
•	To revert to the original graph appearance, just check the Standard graph settings checkbox.  This checkbox is only enabled if you deviate from the standard settings.
	- Clicking the "Standard graph settings" checkbox will also uncheck any policies in the Custom policy bars list.

How do I make custom sleep policies appear on the graph? How do I hide custom sleep policies I am no longer using?
	- If you have added any custom sleep policies (using the Sleep Policy "Add" button in the Sleep Schedules view), these will appear in a list (Custom policy bars) below the Default sleep policy bar  checkbox.  You can check or uncheck any of these custom policies to show or hide its individual bar on the graph.
	- You may have added custom policies in the past, and later deleted or renamed them.  If they have ever been in effect, their bars will still be available on the graph even though they have been deleted, or are not currently used by any Sleep Schedule.  These policies will appear in the Custom policy bars list and can be shown or hidden by checking or unchecking them.
	- The Custom policy bars list is only visible if you have created custom policies, and if these policies have been in effect during the time period currently displayed on the graph; otherwise they cannot be shown on the graph and so do not appear in the list.
	- If you change what time period is displayed on the graph, either by varying the # Days control, or by unchecking the Live checkbox and showing a different start date for the graph, the list of custom policy bars will change depending on which custom policies have been in effect for the time period displayed on the graph.
	- Lets say you have deleted a custom policy and are no longer interested in seeing it on the graph.  You can hide a custom policy using the Hidden Policies dialog; this will remove it from the Custom policy bars list and from the graph.
	- If you have any custom policies, you will see a Hidden Policies button below the list.  This will show the Hidden Policies dialog, which displays all the custom policies you have ever created in a detailed list with the following columns:
•	Hidden - You can click this checkbox to show or hide a policy, regardless of the time period currently displayed on the graph.
•	Deleted policy - Checked if this is a deleted policy.  Deleted policies may still have bars on the graph that occurred prior to the time they were deleted.  A policy can only be deleted in the Sleep Schedules window.
•	# Schedules - How many Sleep Schedules are currently using this policy; blank if this is a deleted policy, or if no schedule is using the policy.
•	First date in effect - The first date this policy has been in effect, and can therefore be shown on the graph.
•	Last date in effect - The last date this policy has been in effect, and can therefore be shown on the graph.
	- You can sort any column in the list by clicking on the title at the top of the column; click again to sort it in reverse order.

I changed the checkboxes in Graph Settings, but nothing happened on the graph!  Why not?
	- If you have zoomed the graph (by checking the Zoom box), any changes in graph settings will only be applied after you exit Zoom (by unchecking the Zoom box).

Sleep Journal

How can I see when and why my computer went to sleep or woke up?
	- The Sleep Journal displays the sleep time intervals (from sleep to wake) with the reason that the computer went to sleep or woke up, while WinSleep was running. By default these are in chronological order, with the most recent interval on top.  If available, the sleep reason and wake reason are shown with each entry.
	- The only sleep reasons known to WinSleep are:
•	the user pressed the Sleep button,
•	the user pressed the Hibernate button, or
•	a Sleep Schedule put the computer to sleep.
If the Windows sleep/hibernate menu was used, or if Windows put the computer to sleep, or if the power button was tapped, the sleep reason is blank since these events are problematic to capture.
	- The wake reasons known to WinSleep are:
•	A WinSleep wake timer woke the computer (this can be wake-at-end for a Sleep Schedule, or a Wake Schedule timer).
•	A wake reason obtained from the Windows Event Log (this can be a program name or possibly a device which woke the computer).
•	A wake reason obtained by running the Windows command:
			"powercfg /lastwake".
•	Any other wake reason will show as blank.

How do I know when WinSleep was running?
	- Time intervals when WinSleep was not running are displayed with Sleep reason "WinSleep ended" and Wake reason "WinSleep started", and a Sleep Mode of "Not running".  The "Prior time up/awake" column shows the previous WinSleep total execution time duration, and the "Time down/asleep" column shows the duration of the "Not running" period.  (The durations have the format days.hours:minutes:seconds.) These periods correspond to gray (Unknown) Power State bars on the Timeline Graph.
How can I find a particular sleep interval or "Not running" period on the Timeline Graph?
	- You can easily cross-navigate between the Sleep Journal and Timeline Graph.
	- Double-click a row in the Sleep Journal to see the corresponding bar in the main window Timeline Graph with a flashing arrow pointing to it.
	- From the Timeline Graph, double-click a sleep/awake/unknown bar to select the corresponding interval line in the Sleep Journal.  If you double-click an awake bar, the immediately preceding sleep/unknown interval is selected in the Sleep Journal.

How can I find all intervals with a particular sleep or wake reason?
	- You can sort the list (in ascending or descending order) by clicking at the top of any column, e.g. click the "Wake reason" column to see identical wake reasons sorted together.

What does the Chronological checkbox do?
	- When checked, it indicates the list is currently displaying in chronological order (most recent on top). If the list is sorted by clicking a column, Chronological will be unchecked and enabled; you can then click Chronological to make the list revert to the default order.
	- When the computer wakes, the list always shows in chronological order, and the new (latest) sleep interval is automatically shown on top of the list.
	- When WinSleep is started, the list is always in chronological order.
How do I find events for a specific date?
	- The calendar control at the top left of the Sleep Journal is enabled when the list is in chronological order, and displays all dates for which WinSleep data has been captured.  Selecting a date from the calendar scrolls the list to the first event of that day.
How can I navigate to the top/bottom of the list?
	- Control-Up-Arrow moves to the top of the list; Control-Down-Arrow to the bottom.  Also, Control-Left-Arrow moves to the leftmost column, and Control-Right-Arrow to the rightmost column.
Sleep Journal lines are confusing; how can I interpret them correctly?
	- For users who like abstract descriptions, here's how to parse a journal line of the form:  (D1, S, T1, R1, D2, T2, R2):
	"The machine was awake/up for duration D1 preceding this event, then transitioned to state S, which started at time T1, for reason R1; the machine remained in this state for duration D2; then exited this state at time T2, for reason R2."

WinSleep Monitor Settings

How do I configure a client WinSleep to accept (authorize) a Monitor connection?
	- Open the Monitor dialog in the client WinSleep.  Note the green Apply button at the top right; if you change monitor settings you must press Apply or OK in order for your changes to take effect.
	- In order for a monitor to connect to this WinSleep, you must check the box "Listen for monitors", and specify a numeric port between 50000 and 60000 (57170 is the default).
	- Once WinSleep is listening for monitors on a given port, monitor requests must still be authorized by some means in order for a response to be sent back.  There are several ways you can authorize a monitor connection:
	- You can check the box "Authorize all monitors", which will allow all monitor connections.  This is the least secure authorization option and is not recommended.
	- You can authorize by password: enter a non-blank password in the text box.  Now any monitor request that specifies this same password will succeed.
	- You can authorize a Monitor by its IP address.  Add the IP address of the Monitor to the "Authorized monitors - IP addresses" table using the Add button.  If you specify a mask here, all IP addresses that satisfy this mask will succeed.  If there is no mask (or the mask is 255.255.255.255) only the single IP address you specify will be authorized.  For example, if you enter an IP address of 192.168.0.0 with a mask of 255.255.0.0, any IP address starting with 192.168 will be authorized.  This is a convenient way of authorizing all Monitor computers that are inside your router.
	- You can authorize a Monitor by its computer name, if the Monitor is on the same router as the WinSleep client (i.e. within the Windows Network Neighborhood).  The Add button to the right of the "Authorized monitors - Computer names" table will show a list of computers in the Network Neighborhood, and you can select the authorized monitor computer.  (There may be a delay of some minutes before this list is populated.)
	- A convenient way of authorizing a Monitor either by IP or computer name is to simply set up the Monitor to poll the WinSleep Client, then open the Monitor dialog of the Client.  Now poll the WinSleep client using WinSleep Monitor.  When the Cllient receives a Monitor request from an unauthorized computer, this will be shown at the bottom of the Monitor dialog; at that time buttons will appear that allow you to easily authorize the Monitor connection either by IP or by computer name.
	- You can authorize any number of Monitors for a given WinSleep.
	- All Monitor communication with WinSleep is encrypted for security.
	- If you have several computers running WinSleep within your local router, and you wish to monitor each of them remotely, specify different monitor ports for each computer running WinSleep, then configure your router to forward each distinct monitor port to the appropriate computer.

How can I tell which monitors are accessing WinSleep?
	- Any Monitor request, whether authorized or not, will be logged in the WinSleep history log if you have checked the Log history box at the bottom of the Monitor dialog.  You can then review the history log to see monitor requests, whether they succeed or fail.  Monitor requests to edit Sleep/Wake schedules or to Sleep/Wake remotely are shown in the WinSleep history log, as well as the normal Monitor polls.  Remember that since Monitor requests may be fairly frequent you may generate lots of history log entries if you have checked "Log history".
	- If the Monitor dialog is open, authorized monitor requests will be reported at the bottom of the dialog; this will include the identity of the Monitor computer, when the request was received, and how the request was authorized.
	- If the Monitor dialog is open, unauthorized monitor requests will be reported at the bottom of the dialog in red, along with green buttons that allow you to authorize the request (by name or IP) if you wish.  This is a convenient way of authorizing a monitor by IP or name.
	- The WinSleep Settings dialog has a "Highlight Monitor button" checkbox.  If checked, the Monitor button on the main window will be highlighted in green (when an authorized monitor request is received) or red (when an unauthorized monitor request is received).  The "reset" delay controls when the button is reset to normal after the last monitor request is received.  You can change the reset delay to anything from 1 second to 1 hour (it is 5 minutes by default).
	- If a remote Sleep/Hibernate command is issued by an authorized Monitor, the Sleep Warning dialog will have the title "WinSleep - Monitor" instead of just "WinSleep".
	- If a remote monitor has changed a sleep/wake schedule, the changes will appear immediately in the local WinSleep Sleep/Wake Schedules View (if open).  (Note Monitor version 1.2.5.0 or greater is required to edit schedules remotely.)

Miscellaneous

What is the History Log?
	- Every time WinSleep is started, a new History Log file is created in the directory %localappdata%\WinSleep\Logs.  (Just type the preceding into a Windows Explorer  navigation bar to display the contents of this directory, or press the button "Explore Logs".)  The files are named WinSleepLog.yyyymmdd_HHMMSS.log, e.g. WinSleepLog.20230308_181213.log is the file created 2023/03/08 at 18:12:13.  These files contain diagnostic information relevant to the operation of WinSleep, and can be opened with Notepad.
	- At startup, the history log will display current WinSleep version and license information, and the number of data records found.
	- The history log will display the date and time when the computer was awakened from sleep.
	- The history log will display the date and time when a Sleep Policy goes into effect, and when it is no longer in effect.
	- Some of the above information is only logged if "Details" is checked at the top of the history log.
	- If you check "Log history" at the bottom of the Monitor Settings dialog, all monitor requests will be shown in the history log, including the identity of the monitor, whether it is authorized (and the authorization method), and the number of bytes sent/received.  Monitor remote Sleep/Hibernate commands are also displayed.

What else is in %localappdata%\WinSleep?
	- This directory contains your license file, a SleepData directory containing the information displayed in the graph and a Config2 directory containing information about Sleep Schedules and Sleep Policies you have created (in the files WinSleep_#.cfg).  Never modify these files manually!
	- The BackupConfig/AutomaticBackups directory contains periodic backups of the WinSleep.cfg file.
	- The CaptureRuns directory contains any captures you have performed (For either Stay Awake Programs or System Information).

How do I navigate between the different views available in WinSleep?
	- You can create several different secondary views: Sleep Journal, Sleep Schedules, Wake Schedules, Stay Awake Programs, System Information and History Log.
	- Each secondary view has a Window button at the top right.  When clicked, this shows a menu of the secondary views; an entry has a check mark if the view is already visible.  Select any of the menu entries to show the corresponding view (this will create the view if it does not already exist).
	- The view configuration is persistent.  For example, if you show the Sleep Journal and change its size and location, it will reappear at the same location with the same size when you restart WinSleep.  The same is true of the other views as well.

Splash Screen

What does the splash screen show?
	- WinSleep version information: 
	- Loading of data records at startup.
	- License validation step.
	- The elapsed time for initialization of the program.

The splash screen is annoying!  Can I turn it off?
	- MollieSoft is deeply sorry that you do not appreciate our beautiful splash screen.  However, to mollify the occasional customer with a distaste for splash screens, we have provided a check box in the "Settings" dialog that you can use to turn the splash screen off.  You can also dismiss the splash screen early by double-clicking it.

WinSleep uses a large area on the screen.  Can I make it smaller?
	- The Compact View button in the top area of the main window toggles between a smaller view and the normal view.  When in Compact View, you see the System Information table (CPU/Disk/Network% usage), the Stay Awake controls, the Sleep/Hibernate buttons, and a Window button used to bring up and navigate among the other views.
	- You can always minimize the main window, and WinSleep will then only be visible as an icon in the System Tray area of your desktop.  All existing views will also be minimized, and will be restored if you double-click the icon.  When minimized, any Sleep Policies will remain in effect and will sleep the computer in the same way as when WinSleep has a visible window.  Check the "Start minimized" box in the Settings dialog if you always want to start WinSleep in this minimized state.

Can Windows also put my computer to sleep, or is this only done by WinSleep?
	- Windows has a facility called the Windows Idle Timer, which ensures that if there is an unattended wake-up event (e.g. for a Windows Update), the computer will go back to sleep in 2 minutes once it returns to an idle state.
	- When running WinSleep should be solely responsible for controlling when the computer wakes and sleeps, so when WinSleep is running the Windows Idle Timer is normally disabled.  Otherwise, say you had scheduled a Wake event in WinSleep; if the Windows Idle Timer were enabled, the computer would just go back to sleep in 2 minutes, which is probably not what you want to happen.
	- However, if you want to change the default WinSleep behavior (which is to disable the idle timer when running), press the Settings button on the Main Window.  Change the checkbox "Allow Windows Idle Timer" to checked.  Now, Windows can put your computer to sleep as well as WinSleep.
	- When running WinSleep, there is really no need to allow the Windows Idle Timer, since a WinSleep Sleep Schedule will do what the idle timer does, with more flexibility.

When I run WinSleep, I get the error:
	".NET Framework error - Could not load Counter name data because invalid index was read from registry"
	- WinSleep depends on Windows performance counters, and this is an indication that the performance counter data in the Windows registry is corrupted.
	- You can repair this registry information as follows:
	Run an elevated (Admin) command prompt.
	Type LODCTR /R.  (Note /R is uppercase.)
	Wait a few seconds for it to throw ERROR: UNABLE TO REBUILD PERFORMANCE COUNTER SETTING FROM SYSTEM BACKUP STORE. ERROR CODE IS 2.
	Type LODCTR /R again!
	This will rebuild the registry performance counter information, and you can then restart WinSleep.
	If WinSleep detects this error at startup, it will perform the above procedure automatically for you (but you will still have to grant admin privilege).

Where do I send comments or suggestions about WinSleep?
	- Email comments or suggestions to:
		support@molliesoft.com
	 or to
		molliesoft@comcast.net