I have done this before.
The easiest way we found out is to build 4 versions of vshadow.exe (a demo tool for quickly starting from VSS from the Microsoft website): one for each target form in XP / later and x86 / x64. VShadow basically allows you to create or destroy a snapshot and retrieve a Path that looks like this:
\\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopyXX
, which you can use to replace the letter of your drive ( D:
for example), which works with the JAVA API . The VShadow version of the VSS SDK is read and written, it is not the same version as exe, which you can download directly, read-only.
Then, in Java, it is easy to write two CLI shells with a unified interface (to handle two different VShadow actions between XP and later).
Good luck.
source share