mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-11-14 22:55:52 -06:00
2.4 KiB
2.4 KiB
Enable Daily Registry Backup Task 12.30am
Last Updated: 2024-08-07
!!! info The Development Documentation is auto generated for every compilation of WinUtil, meaning a part of it will always stay up-to-date. Developers do have the ability to add custom content, which won't be updated automatically.
Description
Enables daily registry backup, previously disabled by Microsoft in Windows 10 1803.
Preview Code
{
"Content": "Enable Daily Registry Backup Task 12.30am",
"Description": "Enables daily registry backup, previously disabled by Microsoft in Windows 10 1803.",
"category": "Features",
"panel": "1",
"Order": "a017_",
"feature": [],
"InvokeScript": [
"
New-ItemProperty -Path 'HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Configuration Manager' -Name 'EnablePeriodicBackup' -Type DWord -Value 1 -Force
New-ItemProperty -Path 'HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Configuration Manager' -Name 'BackupCount' -Type DWord -Value 2 -Force
$action = New-ScheduledTaskAction -Execute 'schtasks' -Argument '/run /i /tn \"\\Microsoft\\Windows\\Registry\\RegIdleBackup\"'
$trigger = New-ScheduledTaskTrigger -Daily -At 00:30
Register-ScheduledTask -Action $action -Trigger $trigger -TaskName 'AutoRegBackup' -Description 'Create System Registry Backups' -User 'System'
"
],
"link": "https://christitustech.github.io/winutil/dev/features/Features/RegBackup"
}
Invoke Script
New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager' -Name 'EnablePeriodicBackup' -Type DWord -Value 1 -Force
New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager' -Name 'BackupCount' -Type DWord -Value 2 -Force
$action = New-ScheduledTaskAction -Execute 'schtasks' -Argument '/run /i /tn "\Microsoft\Windows\Registry\RegIdleBackup"'
$trigger = New-ScheduledTaskTrigger -Daily -At 00:30
Register-ScheduledTask -Action $action -Trigger $trigger -TaskName 'AutoRegBackup' -Description 'Create System Registry Backups' -User 'System'