Wednesday, October 7, 2020

How to Search and Delete with Command Prompt

Open Command Prompt as Admin, run (to delete anything that starts with filename):

for /f "delims=" %i in ('dir /s /b /ad filename*') do rd /s/q "%i"

How to Delete System Restore Points in Windows 10

 

To Delete All or Specific System Restore Points in Command Prompt


1 Open an elevated command prompt.

2 Copy and paste the vssadmin list shadows command into the elevated command prompt, and press Enter.

This will list all shadow copies (restore points) on all drives. You will see the volume drive letter and shadow copy ID number for each one. You will need this information for the steps below.

Delete System Restore Points in Windows 10-vssadmin_list_shadows.png

3 Do step 4 (all), step 5 (all on drive), step 6 (oldest on drive), or step 7 (shadow copy ID) below for how you would like to delete restore points.


 4. To Delete All Restore Points on All Drives

A) Copy and paste the command below you want to use into the elevated command prompt, press Enter, and go to step 8 below. (see screenshot below)

(Prompts Y/N to confirm before deleting)
vssadmin delete shadows /all

OR

(Delete without prompting)
vssadmin delete shadows /all /quiet

Delete System Restore Points in Windows 10-vssadmin_delete_shadows-4.png


 5. To Delete All Restore Points on Specific Drive

A) Type the command below you want to use in the elevated command prompt, press Enter, and go to step 8 below. (see screenshots below)

(Prompts Y/N to confirm before deleting)
vssadmin delete shadows /For=(drive letter): /all

OR

(Delete without prompting)
vssadmin delete shadows /For=(drive letter): /all /quiet

Substitute (drive letter) in the commands above with the drive letter you want. This will be listed as Original Volume: (x: ) from step 2 above.

For example:

vssadmin delete shadows /For=C: /all

OR

vssadmin delete shadows /For=C: /all /quiet

Delete System Restore Points in Windows 10-vssadmin_delete_shadows-1.png
Delete System Restore Points in Windows 10-vssadmin_delete_shadows-2.png


 6. To Delete Oldest Restore Point on Specific Drive

A) Type the command below you want to use into the elevated command prompt, press Enter, and go to step 8 below. (see screenshots below)

(Prompts Y/N to confirm before deleting)
vssadmin delete shadows /For=(drive letter): /oldest

OR

(Delete without prompting)
vssadmin delete shadows /For=(drive letter): /oldest /quiet

Substitute (drive letter) in the commands above with the drive letter you want. This will be listed as Original Volume: (x: ) from step 2 above.

For example:

vssadmin delete shadows /For=C: /oldest

OR

vssadmin delete shadows /For=C: /oldest /quiet

Delete System Restore Points in Windows 10-vssadmin_delete_shadows-5.png


 7. To Delete Specific Restore Point using Shadow Copy ID

A) Type the command below into the elevated command prompt, press Enter, and go to step 8 below. (see screenshot below)

vssadmin delete shadows /Shadow={Shadow Copy ID}

Substitute Shadow Copy ID in the commands above with the actual Shadow Copy ID number of the restore point you want to delete from step 2 above.

For example: vssadmin delete shadows /Shadow={3e351030-9ebd-428c-9ff3-86dca40a7f96}

Delete System Restore Points in Windows 10-vssadmin_delete_shadows-3.png


8 When finished, you can close the elevated command prompt if you like.