
Unfortunately, if you’ve not prepared ahead, all you can really do is long-press the power button.

Typically, you can configure a delay, so after some time running on battery, the software can shut down the computer cleanly on your behalf. Software on the computer - sometimes built into the OS, sometimes software that comes with the UPS - then decides what to do and when. When the power fails, the UPS notifies the computer. Many, if not most, uninterruptible power supplies have the ability to connect to your computer via USB specifically for this scenario. (It also requires that whatever caused your power to fail did not also impact your internet connection.) Let the UPS do it This option, in particular, requires that your network equipment as well as the modem be on your UPS, so in the event of a power outage, your network keeps operating. It’s not a solution for really using the computer for anything significant via your mobile phone’s small screen (though I admit I’ve done that, too, in a pinch), but it’s perfect for just hitting the Start menu and the Shutdown option.

Using my smartphone, I can connect to my home PCs and do just about anything … including turning them off. I happen to use TeamViewer, but there are other alternatives as well. This is one I’ve done while away from home. I’ve even done remote shutdowns via the Windows Command Prompt. I use Microsoft’s Remote Desktop client, or Team Viewer, or some other kind of remote access tool. Then I can easily connect to the machine remotely using a laptop - which, when you think about it, has a built in UPS by virtue of its battery. I have my local network configured to stay running during a power outage by having my routers and access points on the UPS instead of, say, that extra monitor. My approach to that machine is to connect to it using remote access from one of my other machines. I have at least one machine in my basement configured exactly this way: I want to maximize its run time on battery backup, so I purposely don’t plug the monitor into the same UPS.

When your computer is running on the back-up power supplied by the UPS, it won’t run as long, since the computer plus the monitor will drain the UPS’s battery faster than the computer alone. The downside is that screens take power - sometimes a fair amount. Then, when the power goes down, you’ll have both computer and screen running, and can see enough to shut down the computer properly. I assume there’s some reason you can’t, but the simplest solution is to make sure the monitor is also plugged into the UPS. The good news is that if you can plan ahead, there are several reasonable approaches to getting that machine shut down cleanly. Honestly, that’s a tough situation unless you plan ahead for it.
