Monday, February 7, 2011

Reading files in use and system files on Windows XP & Vista using .NET

I have this idea for a free backup application.

The largest problem I need to solve at the moment is how to access files which are being used or are system files. I would like the application to be able to perform a full backup of files (i.e. not on a disk sector by sector level).

I'll turn the server part of the application into a service. First of all this service will need to be run with administrative privileges I guess? And secondly, is it possible to access locked files and files used by the system? Maybe take those files after the next reboot? (I've seen some anti virus applications work that way.)

I will use C# and the .NET platform, as it seems to be the easiest way to develop Windows applications these days.

  • Do a Google on HoboCopy. It is an open source backup tool for windows that can backup files that are in use using Windows Volume Shadow Service.

    Aydsman : The HoboCopy SourceForge project is here: http://sourceforge.net/projects/wangdera/
  • What you're looking for regarding the files in use is the "Volume Shadow Copy Service" which is available on Windows XP, Server 2003 and above. This will allow you to copy files even when they are in use.

    I have found a CodeProject article "Volume Shadow Copies from .NET" which describes a simple Outlook PST backup application written against Volume Shadow Copy.

    From Aydsman
  • Nothing in .NET that could do that directly AFAIK.

    I think you are looking for Volume Shadow Copy on XP/Vista which is designed for this kind of task.

    DeletedAccount : Thank you for the tip! After some searching I found: http://www.codeproject.com/KB/dotnet/makeshadowcopy.aspx At least it seems doable to call these methods from .NET.
    From chakrit

0 comments:

Post a Comment