• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 918
  • Last Modified:

Using Volume Shadow Copy with C++

We're looking to implement VSS into our C++ project, but cannot find any solid information on what functions/headers need to be used. Here's our goal:

1. Check if file is locked/in use.
-CreateFile(hFile,"c:\\windows\\system32\\config\\system", GENERIC_READ,....);
2. If it is locked, generate a volume shadow copy of the file/drive
-SomeVSSFunction();
3. Grab the path to the file
-szFilePath = AnotherVSSFunction();
4. Send the path to the zip function
-zipfile(szFilePath, szDest);

The problem is that I don't know what functions to use to complete my requirements. I have the VSS 7.2 SDK and I looked at the examples. The only applicable one is 'vshadow' but it appears overly complex for my needs. Any ideas or existing code I can take a look at?
0
zystemsgo
Asked:
zystemsgo
  • 2
  • 2
1 Solution
 
TCB1Commented:
Sorry, I just read that you already downloaded the api. Maybe the reference will help?

I know of a program that's freeware that may do what you need. It's called--simply enough--"Shadow Copy". It probably will not help you with your coding project since you don't have the source code.

http://www.runtime.org/shadow-copy.htm
0
 
zystemsgoAuthor Commented:
I have used Shadow Copy as a work around for now, but it just copies the file from one place to another. I'd rather be able to access the shadow volume directly in code and not have to worry about copying/deleting data. Essentially, I'm looking for a C++ wrapper that encapsulates the VSS stuff in a nice class. Thus far I cannot find anything of the sort.
0
 
zystemsgoAuthor Commented:
Closing the question due to inactivity. Awarding points for attempting to help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now