With the AU key selected in the left pane, right-click in the right pane, point to New, and select DWORD (32-bit) value. Type NoAutoRebootWithLoggedOnUsers and press Enter to name the new value.
When the registry editor appears, navigate to the HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU registry key.
You’ll likely find that the last two parts of the key — the WindowsUpdate\AU parts — don’t yet exist. You’ll need to create them yourself.
To do so, right-click the Windows key, point to New, and select Key. Type WindowsUpdate and press Enter. Then, right-click the WindowsUpdate key, point to New, and select Key. Type AU and press Enter. This will create the correct registry key structure.
irst, open the Local Group Policy Editor. Press Windows Key + R to open the Run dialog, type gpedit.msc into the dialog box, and press Enter to open it
Navigate to the following folder in the left pane: Computer Configuration\Administrator Templates\Windows Components\Windows Update
In the right pane, double-click the “No auto-restart with logged on users for scheduled automatic update installations” setting. Set the setting to Enabled and click OK.
After changing this setting, either reboot your computer or run the gpupdate /force command in the way we mentioned above.