JSI Tip 8976. How can I retrieve all the available Restore Points on a Windows XP Professional computer?

Jerold Schulman

January 25, 2005

2 Min Read
ITPro Today logo in a gray background | ITPro Today

I have scripted enumRP.bat to retrieve all the available Restore Points on a Windows XP Professional computer.

The syntax for using enumRP.bat varies based upon your desires:

To list the Restore Points:

enumRP

Would display information similar to:

813 2005 01 19 22 27 36 474168 - 000 "System Checkpoint"814 2005 01 20 21 37 13 396004 - 000 "Installed Windows XP KB884020."815 2005 01 20 22 41 54 599488 - 000 "Installed DropMyRights"816 2005 01 21 23 15 24 024273 - 000 "System Checkpoint"817 2005 01 22 12 58 20 563630 - 000 "Installed Log Parser 2.2"818 2005 01 23 14 45 39 802115 - 000 "CrtRP"819 2005 01 23 14 51 40 299887 - 000 "Restore Operation"

To process all Restore Points:

setlocalfor /f "Tokens=*" %%a in ('enumRP') do ( call :erp %%a)endlocalgoto :EOF:erpset RPSeq=%1set RPYear=%2set RPMonth=%3set RPDay=%4set RPHour=%5set RPMinute=%6set RPSecond=%7set RPMicroSec=%8shiftshiftshiftshiftshiftshiftshiftshiftset RPOffsetSign=%1set RPOffsetMins=%2set RPDesc=%3@echo %RPSeq% %RPYear% %RPMonth% %RPDay% %RPHour% %RPMinute% %RPSecond% %RPMicroSec% %RPOffsetSign% %RPOffsetMins% %RPDesc%

Where:

RPSeq         is the Restore Point Sequence Number.RPYear        is the four digit year that the Restore Point was created.RPMonth       is the 2 digit month that the Restore Point was created.RPDay         is the 2 digit day that the Restore Point was created.RPHour        is the 2 digit hour, using a 24 hour clock, that the Restore Point was created.RPMinute      is the 2 digit minute that the Restore Point was created.RPSecond      is the 2 digit second that the Restore Point was created.RPMicroSec    is the 6 digit microsecond that the Restore Point was created.RPOffsetSign  is the sign, plus or minus, that signifies the offset from UTC (coordinated universal time).RPOffsetMins  is the offset in minutes that the originating time zone deviates from UTC.RPDesc        is the System Restore description.

NOTE: See the following tips:

How can I create a Restore Point in Windows XP, from the command-line, or from a batch?
How can I restore a Windows XP Professional Restore Point from the command-line, or from a batch?
How can I test the status of the last Windows XP Professional System Restore?
How can I use the command-line, or a batch, to disable Windows XP Professional System Restore on one or all drives?

enumRP.bat contains:

@echo offsetlocalset eRPVBS="%TEMP%eRP_%RANDOM%.VBS"@echo set eRP = getobject("winmgmts:\.rootdefault").InstancesOf ("systemrestore")>%eRPVBS%@echo for each Point in eRP>>%eRPVBS%@echo wscript.Echo point.creationtime ^& " 

^& point.description ^&

 " ^& point.sequencenumber>>%eRPVBS%@echo next>>%eRPVBS%set /a cnt=0for /f "Tokens=*" %%r in ('cscript //nologo %eRPVBS%') do (  call :enum %%r)del /q %eRPVBS%endlocalgoto :EOF:enumset rpcrt=%1set rpdesc=%2set rpseq=%3set rpyyyy=%rpcrt:~0,4%set rpmon=%rpcrt:~4,2%set rpday=%rpcrt:~6,2%set rphour=%rpcrt:~8,2%set rpmin=%rpcrt:~10,2%set rpsec=%rpcrt:~12,2%set rpms=%rpcrt:~15,6%set rputcos=%rpcrt:~21,1%set rputcomin=%rpcrt:~22,3%@echo %rpseq% %rpyyyy% %rpmon% %rpday% %rphour% %rpmin% %rpsec% %rpms% %rputcos% %rputcomin% %rpdesc%



Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like