Hardware Power buttons
If you have a separate computer and monitor (screen), you also have separate power buttons, i.e., turning off the monitor power only turns off the monitor, not the computer. All-in-ones and laptops have only one power button.
WARNING: Holding the computer's power button until the computer shuts off is NOT the way to turn a computer off! This action will eventually cause disk drive failure. Use Start menu > Power to properly shutdown.
However, sometimes that may be the only way around a locked up or hijacked computer. With most computers, you need to press and hold the power button for about 10 seconds.
Windows has a variety of power saving settings that can and maybe should be changed. Power settings can turn on screen savers, shut off the monitor and shut down (sleep/hibernate) the computer after xx minutes. To access these settings:
Windows 7 - Start menu > Control Panel > Power Options or right click a blank area of your Desktop, select Personalize then Screen Saver (lower right). From the Screen Saver window, select Change power settings.
Windows 10 - Start menu > Settings > Lock Screen > or right click a blank area of your Desktop, select Personalize then Screen timeout and/or Screen saver settings.
Note: If you do not like having to log on every time the computer's screen saver appears, change that setting by unchecking this option. But if Windows 10 and it's not setup as a local account, we are not sure this would be available.
Depending on the computer and type of computer there may be more or less settings than discussed here. You'll just have to look around...
There are a variety of settings and options and depending on Windows 7 or 10, i.e., Windows 10 has Screen timeout settings which is basic settings but if you want advance settings as discussed next, you need to access Screen saver settings.
You can change what the computer does when the power and/or sleep buttons are pressed.
The timed power settings (display off, sleep, etc.) are available under the Change plan settings...
Under the plan settings may be only 2 options as shown below but laptops have other settings including options for operating on battery and operating when plugged into power...
If you have network shortcuts, you may find they will disappear on occasion. The reason for this is typically when the computer goes to sleep, the network adapter also powers down and then the Windows maintenance "feature" finds shortcuts that are no longer valid and deletes them (nice job Microsoft). You may also find this "feature" deletes pinned network shortcuts (sometimes and that's very frustrating).
Network sharing - leaving computer on 24/7
- If the computer shares data or connected devices to the network, you do not want it turning off, sleeping, hibernating or shutting off the network adapter or the hard drive. If any of these occur, other computers will no longer be able to access those resources. You can however, have the monitor turn off/sleep without affecting the network...
Turn off the network adaptor power scheme.
If a cable connection, go into the Control Panel's Network and Sharing Center then top left, click to change adapter settings. Locate and right click the local area adapter and select Properties.
Click the Configure button and look for a power management tab and/or the Advanced tab for power settings. If it exists, you can turn off the power savings there. See advanced also...
If the computer uses a wireless connection, the settings are likely in the Advanced power settings. From the Control Panel select Power Options then click to change plan settings for whatever scheme is selected.
Then click to change advanced settings to open this window.
Expand each category and change the settings to keep Windows from turning off device when the screen saver kicks in and or the computer goes to sleep.
You especially want to shut off/disable any power savings for hard drive and network (PCI) if the computer is on a network sharing information.
If you're still having problems, turn off the Windows Maintenance feature
In the Control Panel's Troubleshooting > top left, click Change settings and there, simply turn off the maintenance feature.
Note: There may be other fixes for this, see this Microsoft article and try running the FixIt for me utilities.