Delete Scripts/Batch/VSS/Delete Shadow Copies.md
All checks were successful
GitOps Automatic Deployment / GitOps Automatic Deployment (push) Successful in 8s

This commit is contained in:
2025-07-06 18:58:29 -06:00
parent a6b3a96685
commit ecfb8109f1

View File

@ -1,20 +0,0 @@
## Purpose
You may find that you need to delete shadow copies on a disk for any number of reasons such as freeing up space. Sometimes the shadow copies simply don't want to be deleted gracefully. In those circumstances, you can use the two methods seen below to delete the shadows.
!!! warning
These commands will delete **all** shadow copies for the associated drive letter. In these examples, the drive letter will be `D:\`.
### Delete Shadows Via `vssadmin`
Vssadmin is generally the de-facto method of deleting shadows, as it is pretty graceful with the process, but sometimes antivirus might not let you run it thinking you are doing something ransomware-ish. If that happens, defer to the `diskshadow` method seen further below.
```batch
vssadmin delete shadows /for=D: /all /quiet
```
### Delete Shadows via `diskshadow`
This method is a little more aggressive than `vssadmin` and should be only used as a *Plan B* if `vssadmin` doesn't work.
```batch
diskshadow
set context persistent nowriters
delete shadows volume D:
exit
```