[QUESTION] Volume Shadow Copy (VSS) Class

Help needed finding a class for VSS.

Page 1 of 1

1 Replies - 7714 Views - Last Post: 03 July 2010 - 01:32 AM Rate Topic: -----

#1 Apache  Icon User is offline

  • New D.I.C Head

Reputation: 11
  • View blog
  • Posts: 46
  • Joined: 03-November 08

[QUESTION] Volume Shadow Copy (VSS) Class

Posted 09 May 2009 - 09:14 PM

Search Disclaimer:
Prior to posting this thead the original poster (from herein refered to as "OP") submitted various relevent searches on this forum and other similar forums for answers to his question. OP did not find any results for previous topics on this or any similar topic. OP reserves the right to virtual-slap any and all zomgsearchplox trolls.

The Problem:
I am looking for a way to create Volume Shadow Copies of individual files. I have searched accross the net now for classes and code to use but I haven't been able to find anything. I'm only really starting out in .NET and C#, C++ or any other language for that matter are completely alien to me. Everything I've found on the subject, even from Microsoft VSS SDK is either in C# or in C++. I don't want to use any external programs, everything must run from the single exe file.

Target End Result:

I'd like a file at "\global\class\VSSClass.vb" that houses all the code needed.

Public objVSSClassObject As New VSSClass

For in-line code I'd like it as streamined as possible as it will be used with arrays of pre-set filenames.

objVSSClassObject.CopyFile(srcFile, dstDirectory)

Here's a sample of how the code would be used.

Public VSS As New VSSClass
Dim dstDirectory = My.Computer.FileSystem.SpecialDirectories.Desktop & "\Shadow Files"
Dim FilesArray() As String = {"absolute_path_to_file1.txt", _
							  "absolute_path_to_file2.exe", _
							  "absolute_path_to_file3.jpg", _
							  "absolute_path_to_file4.vb"} 'And so on...... array will be filled elsewhere independantly.

If SERVICE_VSS.Status = ServiceProcess.ServiceControllerStatus.Stopped Then
End If

For i As Integer = 0 To UBound(FilesArray)
		VSS.CopyFile(FilesArray(i), dstDirectory)
	Catch ex As Exception
		Message.Show("Shadow Copy Failed: " & ex.Message)
	End Try

If anyone can help me with this I'd be greatful, I'm tearing my hair out searching through page after page of C code and not understanding anything.

This post has been edited by Apache: 09 May 2009 - 09:37 PM

Is This A Good Question/Topic? 0
  • +

Replies To: [QUESTION] Volume Shadow Copy (VSS) Class

#2 LordMike  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 03-July 10

Re: [QUESTION] Volume Shadow Copy (VSS) Class

Posted 03 July 2010 - 01:32 AM


I too have been searching for easy ways to use VSS. Alás, I'm in the same position as you - no results.
However, I have come across a few tools that might lead us in the right direction.

It seems as there are others with the same problem, who have made a managed class which can interact with VSS: AlphaVSS. The project has recently reached Beta 1.0 stage.

It seems that, to use VSS, you must create a snapshot at the instant you need to use a file. Then, VSS will create a virtual drive - with your file - represented by a GUID. The file can then be recovered / readed without restrictions, by browsing to it as follows:

Alternatively, I've seen references to mapping the virtual drive as a letter. Also seen as a result of the tool for XP, "VShadow" from the VSS SDK 7 from Microsoft. I ended up with a D: drive, a VSS copy of my C:. I could then browse all sacred parts of the drive with no nagging "Access Denied" prompts. The drive is still there (The tool crashes when trying to remove it - also crashes when I try to make more snapshots or such. Must be because I'm on Windows 7).

Hope this can be used. Could be awesome with a simple-to-use snippet for copying an array of or a single file(s).

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1