Using Volume Shadow Copy with C++

Posted on 2010-01-05
Last Modified: 2012-05-08
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
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?
Question by:zystemsgo
    LVL 10

    Accepted Solution

    LVL 10

    Expert Comment

    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.

    Author Comment

    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.

    Author Closing Comment

    Closing the question due to inactivity. Awarding points for attempting to help.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    By default, Carbonite Server Backup manages your encryption key for you using Advanced Encryption Standard (AES) 128-bit encryption. If you choose to manage your private encryption key, your backups will be encrypted using AES 256-bit encryption.
    A Bare Metal Image backup allows for the restore of an entire system to a similar or dissimilar hardware. They are highly useful for migrations and disaster recovery. Bare Metal Image backups support Full and Incremental backups. Differential backup…
    The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
    The viewer will learn how to download, install and use CrashPlan from on Windows 8. Open your browser and go to Click get started, it’s free then Click the Download CrashPlan button: Click save in Internet Explorer, the…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now