背景
Windows 11
更新频繁,某些时候设备使用中就自动重启更新了,为了避免系统更新带来不利的影响,在Windows
系统中更改注册表内容修改系统更新时间。使用此种方法没有一些其他意外的情况,想更新的时候手动点击更新即可。
设置
在以下注册表节点下新增PauseFeatureUpdatesEndTime
、PauseQualityUpdatesEndTime
、PauseUpdatesExpiryTime
这三项,字符串类型,时间格式为yyyy-MM-ddTHH:mm:ssZ(2025-02-09T021:56:56Z)
计算机\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings

代码实现
internal class RegeditUtil
{
public static void DelayWindowsUpdate(uint days)
{
//计算机\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings
//要在 windows 更新中,手动点击下暂停更新,注册表中才会出现下面三个项
//PauseFeatureUpdatesEndTime,PauseQualityUpdatesEndTime,PauseUpdatesExpiryTime
//字符串类型,时间格式 2025-02-09T021:56:56Z
DateTime dateTime = DateTime.Now.AddDays(days);
string strDate = dateTime.ToString("yyyy-MM-ddTHH:mm:ssZ");
RegistryKey? reg = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\WindowsUpdate\\UX\\Settings", true);
reg = reg ?? Registry.LocalMachine.CreateSubKey("SOFTWARE\\Microsoft\\WindowsUpdate\\UX\\Settings", true);
if (reg != null)
{
reg.SetValue("PauseFeatureUpdatesEndTime", strDate);
reg.SetValue("PauseQualityUpdatesEndTime", strDate);
reg.SetValue("PauseUpdatesExpiryTime", strDate);
reg.Close();
}
}
}



示例下载
Windows系统更新延期
转载请注明:清风亦平凡 » Windows 11暂停更新时间延期的设置