AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren

Volume Shadow Copy Service

Ein Thema von kopernikus · begonnen am 15. Nov 2014 · letzter Beitrag vom 24. Aug 2022
 
DieDolly

Registriert seit: 22. Jun 2018
2.175 Beiträge
 
#33

AW: Volume Shadow Copy Service

  Alt 23. Aug 2022, 15:53
Sehr altes Thema, möchte aber gerne frage, ob das hier so richtig ist. Basis ist die VsToolkit-Demo.

Meine ganz einfache eigene Demo. Alles was ich nicht brauche ist raus. Es wird nur eine Datei kopiert (bei CopyFile).
Muss man das pro Datei aufrufen oder kann ich bei CopyFile 10 Dateien kopieren?
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
 s: string;
 VolumeShadowCopy: TVolumeShadowCopy;
 VolList: TStringList;
begin
 VolList := TStringList.Create;

 s := GetVolumeUniqueName(SetPathDelimiter('C:\'));
 if length(s) > 0 then
  VolList.Add(s);

 if VolList.Count > 0 then
  begin
   VolumeShadowCopy := TVolumeShadowCopy.Create;
   with VolumeShadowCopy do
    begin
     ListBox1.Items.Add('(Option: Create shadow copy set)');

     // Initialize the VSS client
     Initialize(VSS_CTX_BACKUP);
     // Create the shadow copy set
     CreateSnapshotSet(VolList);

     CopyFile('C:\Windows\explorer.exe', 'C:\explorer.exe', false);

     // Execute BackupComplete, except in fast snapshot creation
     if VssContext and VSS_VOLSNAP_ATTR_DELAYED_POSTSNAPSHOT = 0 then
      begin
       // Complete the backup
       // Note that this will notify writers that the backup is successful!
       // (which means eventually log truncation)
       if VssContext and VSS_VOLSNAP_ATTR_NO_WRITERS = 0 then
        BackupComplete(True);

       DeleteAllSnapshots;
      end;
     ListBox1.Items.Add('Snapshot creation done.');
    end;

   VolList.Free;
  end
 else
  ListBox1.Items.Add('Invalid volume');
end;

Geändert von DieDolly (23. Aug 2022 um 16:28 Uhr)
  Mit Zitat antworten Zitat
 

 
Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:39 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz