Windows updates...Grrr!!!

4 次查看(过去 30 天)
jlt199
jlt199 2016-10-13
评论: DGM 2024-5-29
Does Windows not see Matlab when checking to see if it can do an auto-restart to install updates? I read somewhere that Windows makes sure the computer is not busy before automatically restarting, but alas I came in this morning to find my overnight simulation had been aborted due to Windows installing updates!
:'(

回答(2 个)

Star Strider
Star Strider 2016-10-13
In Win 8.1 (and probably earlier version as well), in the Windows Control Panel, Windows Update gives you some control over this. In Control Panel —> Windows Update, click ‘Change Settings’ to control when the updates are installed. I get a notification on my Win 8.1 machine that Windows will install updates in a day if I don’t install them earlier.
You can access the Windows Update options in Win 10 by clicking on the ‘Windows’ icon in the left of the toolbar, and click on the ‘gear’ icon to access ‘Settings’. Then click on ‘Windows Update’ and explore the options.
That is likely as good as it gets.
  3 个评论
Star Strider
Star Strider 2016-10-13
The Win 10 ‘Windows Update’ allows you to set a custom restart time. That’s probably the only option you have. You can get there through ‘Restart Options’. The problem is that it’s a real pain to have to do that each night if you want to run a long overnight simulation.
With respect to opinions on Win 10, your likely preaching to the choir here! I’ve vented my own frustrations with it from time to time. I refuse to ‘downgrade’ my Win 7 and Win 8.1 machines to Win 10.
Michael
Michael 2024-5-28
This does not work in Windows 10 ot Windows 11.

请先登录,再进行评论。


Michael
Michael 2024-5-28
编辑:Michael 2024-5-28
Windows has an API that enables a process that has a window to block a system shutdown indefinitely until the user manually chooses what to do next. Applications like Matlab receive shutdown notifications through the WM_QUERYENDSESSION and WM_ENDSESSION messages.
Matlab seems to ignore these messages. (Anyone with any clout at The Mathworks, please get them to act on the messages)
While we wait for this feature, I wrote a windows CMD batch file to stop Windows restarting:
for /f "tokens=1 delims=:" %%a in ('time/t') do set currentHour=%%a
if %currentHour% gtr 17 goto after6pm
if %currentHour% gtr 5 goto after6am
set /a startHour = %currentHour%+18
set /a endHour = %currentHour%+6
goto SetActiveHours
:after6pm
set /a startHour = %currentHour%-6
set /a endHour = %currentHour%-18
goto SetActiveHours
:after6am
set /a startHour = %currentHour%-6
set /a endHour = %currentHour%+6
:SetActiveHours
set "activeHours=%startHour%,%endHour%"
reg add "HKLM\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" /v "ActiveHoursStart" /t REG_DWORD /d %startHour% /f
reg add "HKLM\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" /v "ActiveHoursEnd" /t REG_DWORD /d %endHour% /f
If you save this as a batch file and use Task Scheduler to make it a Daily task, to run once an hour it will change your Active Hours so that Windows never restarts until you want it to.
  1 个评论
DGM
DGM 2024-5-29
Thank goodness for simple, obvious solutions to seemingly trivial problems.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 App Building 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by