shadowcopy

raw JSON →
0.0.4 verified Fri May 01 auth: no python

A simple Python library for creating shadow copies (snapshots) of files or directories on Windows using the Volume Shadow Copy Service (VSS). Current version 0.0.4, infrequent releases.

pip install shadowcopy
error ImportError: cannot import name 'create_shadow_copy' from 'shadowcopy'
cause Outdated version or incorrect installation. Library version 0.0.4 may not have the function if installed from a different source.
fix
Run 'pip install --upgrade shadowcopy' and verify import with 'import shadowcopy; print(dir(shadowcopy))'.
error OSError: [WinError 13] The system cannot find the path specified
cause The provided path does not exist or is inaccessible.
fix
Double-check the path and ensure the directory exists.
gotcha shadowcopy only works on Windows with VSS enabled. It will raise an error on Linux/macOS.
fix Use only on Windows, or wrap the call with platform checks.
gotcha The shadow copy path is temporary and may be deleted automatically. Access it quickly after creation.
fix Copy or process the files immediately within a try-finally block.

Creates a VSS snapshot of a directory on Windows and returns the shadow copy path.

from shadowcopy import create_shadow_copy

# Create a shadow copy of a directory
result = create_shadow_copy('C:\\path\\to\\folder')
print(result)  # e.g., '\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\'