DISKSHADOW (Windows Server)

Volume Shadow Copy Service. By default, DiskShadow uses an interactive command interpreter similar to that of DiskRAID or DiskPart. DiskShadow also includes a scriptable mode.

   Start interactive mode:

   Execute a script:
      diskshadow -s script.txt

Commands to run interactively or through a script file:

      add volume Volume [provider ProviderID]
      add alias AliasName AliasValue
      begin backup
      begin restore
      break [writable] SetID
      delete shadows [all | volume Volume | oldest Volume 
                          | set SetID | id ShadowID
                          | exposed {Drive | MountPoint}]
      end backup
      end restore
      exec ScriptFile.cmd
      expose {Drive: | Share | MountPoint}
      list writers [metadata | detailed | status]
      list shadows {all | set SetID | id ShadowID}
      list providers
      load metadata
      load metadata [Drive:][Path]MetaData.cab
      mask ShadowSetID
      revert ShadowCopyID
      set context {clientaccessible | persistent [nowriters] | volatile [nowriters]}
      set option {[differential | plex]
                        [ [rollbackrecover] [txfrecover]
                            | [noautorecover] ]}
      set verbose {on|off}
      set metadata MetaData.cab
      simulate restore
      unexpose {ShadowID | Drive: | Share | MountPoint}
      writer verify [Writer | Component]
      writer exclude [Writer | Component]

   See hover text above.

A shadow copy allows you to take manual or automatic backup copies or snapshots of data at a specific point in time over regular intervals. Using a shadow copy avoids problems with file locking, by creating a read-only copy of the volume, backup programs are able to access every file with no other programs able to lock those same files, this simplifies the creation of consistent backup.

A shadow copy is not created every time a file is changed; backup copies are created automatically once per day, or manually when triggered by a backup or installer application.

Persistent shadow copies can only be made for NTFS volumes.
Nonpersistent (volatile) shadow copies can be made for NTFS and non-NTFS volumes.

In Windows 8 the ability to create persistent shadow copies (Previous Versions) was removed. This is now only available in Windows server.
In a client OS, the Shadow Copy service will only be able to create volatile shadow copies for backup purposes.

Shadow copies on an NTFS volume will be deleted if the NTFS volume is subsequently mounted on an older operating system, either by dual booting or by moving the hard drive.

Use DiskShadow to:

DiskShadow is not supported on Windows Server 2003 or Vista.
DiskShadow.exe replaced vshadow in Windows Server 2008 onwards (vshadow is still available for backwards compatibility).


List all shadows, including their aliases:

C:\> diskshadow.exe list shadows all

Remove the imported shadow copy %Import_1%:

C:\> diskshadow.exe mask %Import_1%

Create a VSS snapshop of drive D: and expose it as Read-Only drive S:

C:\> diskshadow.exe
Set context persistent
ADD volume D: alias ddrive
Set verbose on
expose %ddrive% S:

Now backup the contents of S: (with copy or robocopy)
When no longer needed, delete the snapshop and remove S:
DELETE shadows volume D:
unexpose S:

Create a VSS snapshop of drive D:

C:\> diskshadow.exe
Set context persistent
Set metadata C:\docs\ss64.cab
#The (transportable) shadow copy is not in the system yet.
#You can reset or exit now if you wish.
# Import the diskshadow
Load metadata C:\docs\ss64.cab

#The shadow copy will now be loaded into the system.

“I don’t need a friend who changes when I change and who nods when I nod; my shadow does that much better” ~ Plutarch

Related commands

DISKPART - Disk Administration.
VSSADMIN - Volume Shadow Copy.
Where’s my disk space - Jeff Hughes [MSFT]

Copyright © 1999-2024 SS64.com
Some rights reserved