Site icon Winhelponline

How to Create System Restore Points using Script or Command-Line

System Restore is a valuable feature in Windows that helps you easily recover the system in the event of any misconfiguration. If you’ve been using the System Restore feature regularly, then you need to know how to create System Restore Points with a single click using the command-line. You can also do this by scripting it using WMI or PowerShell.

This article discusses some methods to quickly create a System Restore point in a single click in Windows 11, Windows 10, and earlier Operating Systems.

Create System Restore Points using Command-line or Script

Three methods are discussed for quick restore point creation: using the WMI command-line, PowerShell, or VBScript.

Method 1: Restore Point creation using WMIC

  1. Open an elevated (admin) Command Prompt.
  2. Type the following command and press ENTER:
    Wmic.exe /Namespace:\\root\default Path SystemRestore Call CreateRestorePoint "My Restore Point", 100, 7

    (or)

    Wmic.exe /Namespace:\\root\default Path SystemRestore Call CreateRestorePoint "My Restore Point", 100, 12

    (or)

    Wmic.exe /Namespace:\\root\default Path SystemRestore Call CreateRestorePoint "%DATE%", 100, 1

    You should see the following output. The return value 0 indicates that the restore point creation was successful.

    Note that if the above command-line outputs the return value 0 too quickly (within a few seconds), then it’s possible that a restore point already exists/was created within the last 24 hrs; so WMIC didn’t create a new one. Yet, you’ll see the return value 0 (“Success”) in the output.

    Executing (SystemRestore)->CreateRestorePoint()
    Method execution successful.
    Out Parameters:
    instance of __PARAMETERS
    {
    ReturnValue = 0;
    };

    If the System Restore feature has been disabled, the above WMIC command will throw the following error:

    Executing (SystemRestore)->CreateRestorePoint()
    ERROR:
    Description = The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.

    To enable System Restore, open System Properties (sysdm.cpl) → System Protection → Configure → Enable the “Turn on system protection” option.

  3. Exit the Command Prompt window.

This creates a restore point automatically. You can open the System Restore (rstrui.exe) window to verify.

System Restore window in Windows 11

Note that the customized label/description (“My Restore Point”) for the restore point is working. It doesn’t when you use the script method.

Optionally, you may create a desktop shortcut to the above WMIC command-line, assign an icon (from rstrui.exe) and set it to run as administrator when double-clicked.

(Prefix the target path with cmd /k (and space) command before the wmic.exe command-line.)

Double-click the shortcut whenever you want to to create a System Restore point.


Method 2: Restore Point creation using PowerShell command-line

To create a restore point using PowerShell:

  1. Right-click on the desktop and click New. Select shortcut
  2. Type the following command-line for the shortcut target:
    PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile -ExecutionPolicy Bypass -NoExit -Command "Checkpoint-Computer -Description "MyRestorePoint" -RestorePointType "MODIFY_SETTINGS"; " ' " -Verb RunAs}"
  3. Assign a name for the shortcut (say, Create Restore Point)
  4. Double-clicking the shortcut will create a system restore point automatically. You’ll be asked for elevation permission.

Method 3: Restore Point creation using Script

The script method has a couple of advantages. It allows you to assign a custom restore point description in pre-Windows 10 systems. Secondly, on Windows 8, Windows 10, and Windows 11, the script can create a restore point even if an earlier restore point was created in the last 24 hours; refer to the SystemRestorePointCreationFrequency registry value mentioned at the end of this post. This is not possible if you use the command-line or PowerShell method.

  1. Download create_restore_point.zip
  2. Extract the VBScript to a folder of your choice, say D:\Scripts.
  3. Double-click the file create_restore_point.vbs to run it.

You’ll see the elevation prompt, and after you provide your consent, the script creates a restore point automatically in Windows 11/10.

(The script does not show a confirmation message box if the operation has been successful. But, if the script encounters an error, it shows you the error code encountered.)

Script behavior in Windows 8 and earlier

You’ll see the following input box prompt to assign a custom description for it. This prompt appears only if you’re running Windows 8 or earlier.

When you see the following prompt, type the description and press ENTER. The description you provided here will reflect in the System Restore dialog.

The input box is prepopulated with the phrase Manual Restore Point. You may use the default description or modify it accordingly before clicking OK.

Tip #1: If you want to use the default description and don’t want the input box to appear, edit the file create_restore_point.vbs using Notepad, and delete line #37 (the line that starts with the following code), and save the file.

sDesc = InputBox ("Enter a description.".......

Note: You won’t see the above input box if the script detects you’re using Windows 11/10. That’s because due to a change in Windows 10 v1607 and higher, custom restore point descriptions don’t work. In Windows 10/11, automated or scripted restore points are always named Automatic Restore Point.

Tip #2: You may create a shortcut to the script, place it in your Start menu or taskbar, and customize the shortcut icon accordingly. You can use the restore point icon in C:\Windows\System32\rstrui.exe.

To pin the shortcut to the script to Taskbar or Start menu, edit the script shortcut’s properties and include wscript.exe before the target path.


Troubleshooting: Restore Point not created when using WMIC or PowerShell method?

In Windows 8 and higher, if an application or script calls the CreateRestorePoint method to create a restore point, Windows skips creating this new restore point if any restore points have been created in the last 24 hours.

So, if the above PowerShell or WMIC command-line doesn’t create a restore point for you, it’s probably because there is another restore point created within the last 24 hours. In that case, the PowerShell method may show the following warning:

WARNING: A new system restore point cannot be created because one has already been created within the past 1440 minutes. The frequency of restore point creation can be changed by creating the DWORD value ‘SystemRestorePointCreationFrequency’ under the registry key ‘HKLM\Software\Microsoft\Windows NT\CurrentVersion\SystemRestore’. The value of this registry key indicates the necessary time interval (in minutes)

The frequency of restore point creation can be changed by creating the DWORD value SystemRestorePointCreationFrequency under the registry key:

HKLM\Software\Microsoft\Windows NT\CurrentVersion\SystemRestore

The value data of this registry value indicates the necessary time interval (in minutes) between two restore point creation. The default value is 1440 minutes (24 hours).

Related articles

If you’re aware of any other command-line or script method to automate system restore point creation, let’s know in the Comments section below.

Exit mobile version