Answer the question
In order to leave comments, you need to log in
Is it possible to manage Windows restore points from a string?
The task is as follows:
1. Delete all old points.
2. Create a new one.
It is necessary to implement it in the line without involving third-party software. A multi-version solution is desirable, that is, it works on different versions of Windows, starting at least with XP.
Thanks in advance.
Answer the question
In order to leave comments, you need to log in
Perhaps with the help of a WMI script called from the command line. But the script will need administrator rights.
More details here support.microsoft.com/?kbid=295299
If the task is to create restore points on users' machines on the network, then this is done through Group Policy using the same WMI script in the startup section.
A quick googling turned up the disappointing "The 'SystemRestore' WMI class doesn't support deleting a restore point."
However, you can go the Komsomol way: kill all SRPs and create a new one. Something like this script:
If you have programming skills, then you can use this hint: msdn.microsoft.com/en-us/library/aa378934.aspx
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\default")
Set objItem = objWMIService.Get("SystemRestore")
errResults = objItem.Disable("")
Set IRP = getobject("winmgmts:\\.\root\default:Systemrestore")
MYRP = SRP.createrestorepoint ("New SRP", 0, 100)
You can delete old restore points using WMI as follows:
wmic shadowcopy delete
The command is interactive. Just checked, deleted one of the points.
You can create points with the command:
wmic shadowcopy call create
But I have not yet figured out how to do it, because I don’t understand what parameters to substitute after create
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question