Wikipedia:Reference desk/Archives/Computing/2024 August 31

Computing desk
< August 30 << Jul | August | Sep >> September 1 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


August 31

edit

Why Did Windows 11 Computer Restart Itself?

edit

I was working at my Dell desktop computer, running Windows 11, and stepped away for a little less than an hour. When I came back, I saw that Outlook was opening all of the windows that had been open when I took my dinner break. I then observed that Word and Access had been restarted, and Word had restored two documents from Autorecovery. This wasn't in the time window that I have specified for automatic restarts. Is there a log that records why the computer was restarted? Why did the computer restart itself? Robert McClenon (talk) 02:07, 31 August 2024 (UTC)[reply]

There's a chance your computer had a BSOD while you were away. You can verify it by checking for any BugCheck events in the event viewer. Ian P. Tetriss (talk) 15:29, 31 August 2024 (UTC)[reply]
Thank you, User:Ian P. Tetriss - There was a RestartManager event logged just about at the time that I went back to my computer, that said that Windows Explorer could not be shut down. I haven't gotten any more information at this time, but this confirms that there was some sort of event. Robert McClenon (talk) 19:12, 31 August 2024 (UTC)[reply]
A cat could have pressed the power button even. Luhanopi (talk) 20:00, 31 August 2024 (UTC)[reply]
In my cynicism, I suspect it was an update, and the designated time window was treated only as a suggestion.  Card Zero  (talk) 08:32, 1 September 2024 (UTC)[reply]
The cat presses the keys on the keyboard. She doesn't press the power button. The computer is a desktop model, and the power button is facing forward about eighteen inches off the floor. That isn't where the cat would have anything to do with it. I would not be surprised if it was an update that didn't respect the time window. Robert McClenon (talk) 17:34, 1 September 2024 (UTC)[reply]
I've had Windows updates ignore the time window before. I can't offer any technical insight into why, just confirm that it does happen. DuncanHill (talk) 17:38, 1 September 2024 (UTC)[reply]
You can use external software to prevent automatical updates. But check them biweekly then.
--Luhanopi (talk) 17:48, 1 September 2024 (UTC)[reply]

This answer is based on Windows 10. I don't think Microsoft has changed any of this for Windows 11 but I'm not sure.

If it was Windows update, this should show be clear in Event Viewer. E.g. Event 1074 for User32 would be something like:

The process C:\Windows\system32\svchost.exe (COMPUTERNAME) has initiated the restart of computer COMPUTERNAME on behalf of user NT AUTHORITY\SYSTEM for the following reason: Operating System: Service pack (Planned)
Reason Code: 0x80020010
Shut-down Type: restart
Comment:

As mention above, a restart due to system error should also be clear from the Event Viewer, beyond the bugcheck you'd also get a critical event from Event 41, Kernel-Power The system has rebooted without cleanly shutting down first. This error could be caused if the system stopped responding, crashed, or lost power unexpectedly. although as the event says this could also be due to a sudden power loss, so you'd want to look at other stuff like the bugcheck to try and work out what went wrong. Although you may not always be able to work out exactly what went wrong. E.g. unless you have some sort of hardware monitoring, I don't think you could tell the difference from pulling out the power cable of a system without a built in battery, and a system that died due to thermal protection, and even pushing the reset switch. For that matter, rarely you might get an error which does BSOD which I think there might not be signs of. Still, you at least have the idea it was a sudden unclean shutdown.

Probably the most uninformative is the typical

The process C:\Windows\System32\RuntimeBroker.exe (COMPUTERNAME) has initiated the restart of computer COMPUTERNAME on behalf of user COMPUTERNAME\USER for the following reason: Other (Unplanned)
Reason Code: 0x0
Shut-down Type: restart
Comment:

This could be a simple you restarted via the GUI. It could be something else. You can look for other events which might reveal stuff, but you might not always find stuff. Note that with the majority of desktop computers, pushing the power button on the keyboard will either turn the computer off or put it to sleep. It will not restart the computer. If you push it once and the computer shutdowns then push it again later it may start back up, but this should show up as a shutdown rather than a restart in Event Viewer. Likewise if somehow you push the reset switch, as I noted above this should show up as an unclean shutdown.

I don't think it's very common for computers to have soft restart switches since it's not considered necessary. I think some variants of *nix, may show up a shutdown menu where you can chose what you want to do when you push the poweroff button or for that matter the ACPI soft-off switch. And I'm sure you could get something which would do that in Windows as well, or maybe there's even a way to change some setting somewhere to do that. But I assume you'd still need to click on restart.

Nil Einne (talk) 09:37, 2 September 2024 (UTC)[reply]

In the future, you could consider disabling Reboot after BSOD Luhanopi (talk) 09:41, 2 September 2024 (UTC)[reply]

You could but I don't see the reason for that. AFAIK, all the details that screen provides will be in the Event 1001 BugCheck event. Also I should mention that there are variants of restarts e.g. depending on what's being installed you might get

The process C:\Windows\servicing\TrustedInstaller.exe (COMPUTERNAME) has initiated the restart of computer COMPUTERNAME on behalf of user NT AUTHORITY\SYSTEM for the following reason: Operating System: Upgrade (Planned)
Reason Code: 0x80020003
Shut-down Type: restart
Comment:

instead of the service pack one. There's also

The process C:\Windows\system32\MusNotificationUx.exe (COMPUTERNAME) has initiated the restart of computer COMPUTERNAME on behalf of user COMPUTERNAME\USERNAME for the following reason: Operating System: Service pack (Planned)
Reason Code: 0x80020010
Shut-down Type: restart
Comment:

I might actually be confused earlier and the TrustedInstaller ones are generally for restarts required during updates and the MusNotificationUx ones are for restarts to initiate installation, not sure. You could look more if it matters, but my main point is if it's a regular restart by the system for an update, it should be clear from the Event 1074 that this happened. If it instead shows up as an unplanned restart, this suggests something else whether a GUI initiated restart, a command line one, or something else. If you installed some weird software to manage updates, perhaps this will also show up as a simple unplanned restart.

Nil Einne (talk) 10:13, 2 September 2024 (UTC)[reply]

BTW, to be clear, if you restart via the GUI even if you tell it to update, I think this will generally show up as a unplanned restart. Although you can look at the Windows update events and confirm that an update was awaiting restart and installed after you restarted. However this wasn't a force restart per se, even if you did it because you knew you'd eventually be forced. (Sort of, AFAIK, the 7 day rolling delay is technically infinite.) Nil Einne (talk) 10:16, 2 September 2024 (UTC)[reply]
Soul it happen again, you ruled out BSOD Luhanopi (talk) 11:52, 2 September 2024 (UTC)[reply]
Nil Einne said: "I don't think it's very common for computers to have soft restart switches since it's not considered necessary." In my experience, every bare mobo I ever bought, and many cases, had a soft restart jumper/button. They may be not so common now. OTOH, most machines from big manufacturers (eg Dell) don't tend to fit them - confuses the users, etc. If you press and hold the power button for at least 6 seconds, this almost always forces a power down. Most BIOSes/setup progs have a setting which controls the state after a complete power loss (eg after a power cut). For home users power on (or last state) is probably best; in business environments, power off may be preferred, which can prevent a power surge/blown fuse with all the servers coming on all at once, UPS notwithstanding. MinorProphet (talk) 14:05, 13 September 2024 (UTC)[reply]

Documentation for Event Viewer

edit

Does the Event Viewer contain its own documentation? Where can I find instructions on how to use the Event Viewer? Robert McClenon (talk) 18:24, 1 September 2024 (UTC)[reply]

[1] - Internet doc. Luhanopi (talk) 18:32, 1 September 2024 (UTC)[reply]
At first sight. Haven't been throrugh Luhanopi (talk) 18:33, 1 September 2024 (UTC)[reply]
Not that good. Will leave as it may be useful still. Luhanopi (talk) 18:33, 1 September 2024 (UTC)[reply]

Controlling printed page in HTML

edit

I am developing a web application whose front end is done in plain HTML and CSS. One of the pages shows a printable page with rows of pretty much identical <div> elements that look like rectangular text boxes of identical width and height, only the text contents of the elements vary.

Now there is a new requirement that the number of these elements that end up on each individual sheet of paper when physically printing the document should be configurable. Is there any other way to do this than fine-tuning the CSS layout of the page to get the height of these elements and the space surrounding them to match the height of the paper? JIP | Talk 11:16, 31 August 2024 (UTC)[reply]

You can specify different CSS for different media types. For instance you can enforce page breaks in appropriate places. Ruslik_Zero 14:42, 31 August 2024 (UTC)[reply]
Thanks, the section "Page breaks" seems to be exactly what I need to do. JIP | Talk 19:19, 31 August 2024 (UTC)[reply]
In general, i'd say that restrictions like this are pretty unfeasible to guarantee in HTML. It is a markup language (designed for a single page medium), and not a typesetting language. You get very little control about positioning, esp wrt the concept of a 'page'. You can do some best effort with page break suggestions, but that is about it. —TheDJ (talkcontribs) 08:55, 1 September 2024 (UTC)[reply]
I use page-break-after for elements to force them to break to a new page. The issue is setting the div height. I scanned two books on CSS and I am not sure if vh is relative to the page size when printing or not. If it is, you can easily adjust divs to a percent of print space height using vh. If it is locked to the window's viewport, that won't work. 75.136.148.8 (talk) 12:05, 2 September 2024 (UTC)[reply]