Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6951091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:10:31+00:00 2026-05-27T14:10:31+00:00

I’m writing an Excel file recovery program with VB.Net that tries to be a

  • 0

I’m writing an Excel file recovery program with VB.Net that tries to be a convenient place to gather and access Microsoft’s recommended methods. If your interested in my probably kludgy, error filled, and lacking enough cleanup code it’s here: http://pastebin.com/v4GgDteY. The basic functionality seems to work although I haven’t tested graph macro table recovery yet.

It occurred to me that Vista and Windows 7 users could benefit from being offered a list of previous versions of the file within my application if the Shadow Copy Service is on and there are previous copies. How do I do this?

I looked at a lot of web pages but found no easy to crib code. One possibility I guess would be to use vssadmin via the shell but that is pretty cumbersome. I just want to display a dialogue box like the Previous Versions property sheet and allow users to pick one of the previous versions. I guess I could just display the previous version property sheet via the shell by programmatically invoking the context menu and the “Restore previous versions choice”, however I also want to be able to offer the list for Vista Home Basic and Premium Users who don’t have access to that tab even though apparently the previous versions still exist. Additionally if it possible I would like to offer XP users the same functionality although I’m pretty sure with XP only the System files are in the shadow copies.

I looked at MSDN on the Shadow Copy Service and went through all the pages, I also looked at AlphaVSS and AlphaFS and all the comments. I’m kind of guessing that I need to use AlphaVss and AlphFS and do the following?

  1. Find out the list of snapshots/restore points that exist on the computer.
  2. Mount those snapshots.
  3. Navigate in the mounted volumes to the Excel file the user wants to recover and make a list of those paths.
  4. With the list of paths handy, compare with some kind of diff program, the shadow copies of the files with the original.
  5. Pull out the youngest or oldest version (I don’t think it matters) of those shadow copies that differ from the recovery target.
  6. List those versions of the files that are found to be different.

This seems cumbersome and slow, but maybe is the fastest way to do things. I just need some confirmation that is the way to go now.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:10:32+00:00Added an answer on May 27, 2026 at 2:10 pm

    I finally decided to go ahead and start coding. Please make suggestions for speeding up the code or what do with files that are found to be different from the recovery file target. Is there a simpler way to do this with AlphaVSS and AlphaFS?

    Private Sub Button1_Click_2(sender As System.Object, e As System.EventArgs) Handles Button1.Click
    
        'Find out the number of vss shadow snapshots (restore 
        'points). All shadows apparently have a linkable path 
        '\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy#,
        'where # is a simple one, two or three digit integer.
        Dim objProcess As New Process()
        objProcess.StartInfo.UseShellExecute = False
        objProcess.StartInfo.RedirectStandardOutput = True
        objProcess.StartInfo.CreateNoWindow = True
        objProcess.StartInfo.RedirectStandardError = True
        objProcess.StartInfo.FileName() = "vssadmin"
        objProcess.StartInfo.Arguments() = "List Shadows"
        objProcess.Start()
    
        Dim burp As String = objProcess.StandardOutput.ReadToEnd
        Dim strError As String = objProcess.StandardError.ReadToEnd()
        objProcess.WaitForExit()
        Dim xnum As Integer = 0
        Dim counterVariable As Integer = 1
        ' Call Regex.Matches method.
        Dim matches As MatchCollection = Regex.Matches(burp, _
                                "HarddiskVolumeShadowCopy")
        ' Loop over matches.
        For Each m As Match In matches
            xnum = xnum + 1
            'At the max xnum + 1 is the number of shadows that exist
        Next
        objProcess.Close()
    
        Do
            'Here we make symbolic links to all the shadows, one at a time 
            'and loop through until all shadows are exposed as folders in C:\.
            Dim myProcess As New Process()
            myProcess.StartInfo.FileName = "cmd.exe"
            myProcess.StartInfo.UseShellExecute = False
            myProcess.StartInfo.RedirectStandardInput = True
            myProcess.StartInfo.RedirectStandardOutput = True
            myProcess.StartInfo.CreateNoWindow = True
            myProcess.Start()
            Dim myStreamWriter As StreamWriter = myProcess.StandardInput
            myStreamWriter.WriteLine("mklink /d C:\shadow" & counterVariable _
                & " \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy" _
                & counterVariable & "\")
            myStreamWriter.Close()
            myProcess.WaitForExit()
            myProcess.Close()
    
            ' Here I compare our recovery target file against the shadow copies
            Dim sFile As String = PathTb.Text
            Dim sFileShadowPath As String = "C:\shadow" & _
                counterVariable & DelFromLeft("C:", sFile)
            Dim jingle As New Process()
            jingle.StartInfo.FileName = "cmd.exe"
            jingle.StartInfo.UseShellExecute = False
            jingle.StartInfo.RedirectStandardInput = True
            jingle.StartInfo.RedirectStandardOutput = True
            jingle.StartInfo.CreateNoWindow = True
            jingle.Start()
            Dim jingleWriter As StreamWriter = jingle.StandardInput
            jingleWriter.WriteLine("fc """ & sFile & """ """ _
                                   & sFileShadowPath & """")
            jingleWriter.Close()
            jingle.WaitForExit()
            Dim jingleReader As StreamReader = jingle.StandardOutput
            Dim JingleCompOut As String = jingleReader.ReadToEnd
            jingleReader.Close()
            jingle.WaitForExit()
            jingle.Close()
            Dim jingleBoolean As Boolean = JingleCompOut.Contains( _
                "no differences encountered").ToString
            If jingleBoolean = "True" Then
                MsgBox(jingleBoolean)
            Else
                'I haven't decided what to do with the paths of 
                'files that are different from the recovery target.
                MsgBox("No")
            End If
    
            counterVariable = counterVariable + 1
        Loop Until counterVariable = xnum + 1
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
i want to parse a xhtml file and display in UITableView. what is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.