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
SERVICE_VSS.Start()
End If
For i As Integer = 0 To UBound(FilesArray)
Try
VSS.CopyFile(FilesArray(i), dstDirectory)
Catch ex As Exception
Message.Show("Shadow Copy Failed: " & ex.Message)
End Try
Next
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

New Topic/Question
Reply



MultiQuote




|