0

As the undermentioned demonstrates:

image

The Start Menu (Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy) is able to invoke a reboot without updating the OS. However, file:///%SYSTEMROOT%/system32/shutdown.exe and PowerShell (Core)'s Stop-Computer commandlet don't appear to provide any option to control whether Windows decides to.

I want this capability because I dual-boot with Linux-based OSes, which necessitates that I adhere to this advice to update Windows:

So the fix where you have Linux/Windows dual boot using standard DOS MBR and GRUB on the Linux partition set active to perform OS selection is to set the Windows partition active before reboot after installing Windows Updates and set it back to Linux afterward.

Because I don't always want to automate that process due to the installed OSes somewhat frequently changing, I reboot into a Fedora 40 SSD via my MB's UEFI GUI, which I invoke programmatically:

#!/usr/bin/env -S pwsh

#Requires -RunAsAdministrator

If ([OperatingSystem]::IsWindows() -Eq $True) {shutdown /r /fw /t 0} # Originated at [this URI](https://superuser.com/revisions/1803550/3#:~:text=shutdown%20/r%20/fw%20(requires%20elevation)%20per%20Microsoft's%20documentation).

However, as aforexplained, this can break when an update is to be applied, due to its inability to specify whethe to apply an update. Consequently, how do I imitate what the Start Menu is doing?

5
  • The only downside to hibernating Windows OS, rather performing shutdown, before booting Linux from the same drive is that writing to the Windows partition is not feasible. On the two dual-boot PC's I still use (others are Linux-only, now) it works well and does not trigger updates. Of course, while I can run an application in wine from that NTFS partition, changing settings, or using its repository (e.g., Calibre library) is out, unless I do a full shutdown of Windows. Commented Jun 30 at 5:04
  • @DrMoishePippik, why Hibernate then, instead of choosing the mere "Shut Down" option, as aforedepicted? Commented Jun 30 at 8:55
  • 1
    Hibernate does not signal the OS that you're finished, and it's OK to initiate an update. Commented 2 days ago
  • @DrMoishePippik, indeed. However, because it reinitializes the system's memory to almost exactly what it was beforehand, it's not a reboot for the standard purposes of one - that is, to reinitialize processes. Commented 2 days ago
  • 1
    Correct... use Hibernate to switch OS, and Shutdown when needed for other purpose. Commented 2 days ago

0

You must log in to answer this question.