diff --git a/internal/fs/file_windows.go b/internal/fs/file_windows.go index 50c7e9938..31d495509 100644 --- a/internal/fs/file_windows.go +++ b/internal/fs/file_windows.go @@ -20,6 +20,15 @@ func fixpath(name string) string { if strings.HasPrefix(abspath, `\\?\UNC\`) { return abspath } + // Check if \\?\GLOBALROOT exists which marks volume shadow copy snapshots + if strings.HasPrefix(abspath, `\\?\GLOBALROOT\`) { + if strings.Count(abspath, `\`) == 5 { + // Append slash if this just a volume name, e.g. `\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopyXX` + // Without the trailing slash any access to the volume itself will fail. + return abspath + string(filepath.Separator) + } + return abspath + } // Check if \\?\ already exist if strings.HasPrefix(abspath, `\\?\`) { return abspath