New
#10
Hello @Brink,
I have put this CMD Batch Script together to extract the information which could possibly be an added option in the Tutorial:
Code:@echo off fsutil Dirty Query %SystemDrive% > nul && goto:[RunAs] echo CreateObject^("Shell.Application"^). ^ ShellExecute "%~0","+","","RunAs",1 > "%Temp%\+.vbs" && "%Temp%\+.vbs" & Exit :[RunAs] echo. PowerShell ^ $Arr_EventType=@{100='BEGIN_SYSTEM_CHANGE'; 101='END_SYSTEM_CHANGE'; 102='BEGIN_NESTED_SYSTEM_CHANGE'; 103='END_NESTED_SYSTEM_CHANGE'}; ^ $Arr_RestorePointType=@{0='APPLICATION_INSTALL'; 1='APPLICATION_UNINSTALL'; 10='DEVICE_DRIVER_INSTALL'; 12='MODIFY_SETTINGS'; 13='CANCELLED_OPERATION'; 16='OTHER'}; ^ $Tot=((Get-ComputerRestorePoint) ^| Measure-Object).Count; ^ $List=(Get-ComputerRestorePoint ^| Sort-Object -Property CreationTime -Descending ^| Format-Table -AutoSize ^ @{L='Creation Time' ;E={;if([string]::IsNullOrWhiteSpace($_.CreationTime)) {'-'} else {$_.ConvertToDateTime($_.CreationTime).ToString()}}}, ^ @{L='Description' ;E={;if([string]::IsNullOrWhiteSpace($_.Description)) {'-'} else {$_.Description}}}, ^ @{L='Sequence Number' ;E={;if([string]::IsNullOrWhiteSpace($_.SequenceNumber)) {'-'} else {$_.SequenceNumber}};A='Left'}, ^ @{L='Event Type' ;E={;if([string]::IsNullOrWhiteSpace($_.EventType)) {'-'} else {$Arr_EventType[[int]$_.EventType]}}}, ^ @{L='Restore Point Type';E={;if([string]::IsNullOrWhiteSpace($_.RestorePointType)) {'-'} else {$Arr_RestorePointType[[int]$_.RestorePointType]}}} ^| ^ Out-String -Width 1000).Trim("""`r`n"""); ^ if ($List.Length) {Write-Host """`n--- System Restore Point(s) [$Tot] - Sorted by [CreationTime -Descending] ---`n`n `n`n$List"""} else ^ {Write-Host """`n--- NO System Restore Point(s) Available ---"""; exit 1} >> %Temp%\A.txt for /f "delims=" %%i in (%Temp%\A.txt) do echo. %%i del %Temp%\A.txt echo. & echo ^>Press ANY key to EXIT . . . & pause >nul & Exit
NOTE:- If the%Temp%
folder path contains spaces and special characters etc, then enclose the path in quotes.
@thename,
This might also help with your data query !
Last edited by Paul Black; 26 May 2023 at 16:21.