November 2011

Copying locked files using Windows’ Volume Shadow Service – José García

Using the Volume Shadow Service (VSS) in 32 bit environments has been possible with Delphi since VSS’s introduction in Windows XP. However using these COM objects in 64 bit evironments has not been possible with Delphi until now, as the program using them has to be a native 64 bit application. Two years ago I had to use C++ to write part of an application in order to use the VSS in 64 bit OS’s.
Now that Delphi compiles native 64 bit applications, I have ported my code back to my favourite language.
In this half hour we’ll look at why it was impossible to use the Volume Shadow Service without 64 bit support, and how Delphi XE2 brought a smile back to my face. To demonstrate, we’ll make a bare bones utility to copy open and locked files.