Windows Vista Forums

Need example of backing up disk....

  1. #1


    jim Guest

    Need example of backing up disk....

    I'd like to get some .net sample code that shows me how to make a complete
    backup of a hard drive (like my C: drive) to another location (say my D:
    drive) while the C: drive is in use.



    Basically, I'd like to make and give away free backup software because
    Acronis has given me so many problems.

    Any help or links you could provide would be greatly appreciated. (Please
    include your name to be added to the credits screen in the free
    application.)

    jim



      My System SpecsSystem Spec

  2. #2


    Peter Duniho Guest

    Re: Need example of backing up disk....

    Please don't cross-post so liberally. It is especially inappropriate to
    cross-post between two different language groups. If you really want
    language-agnostic advice, pick a non-language-specific newsgroup (like
    m.p.d.framework) and post your question there. (follow-ups to C#
    newsgroup)

    As for your specific question:

    On Thu, 22 May 2008 16:21:08 -0700, jim <jim@xxxxxx> wrote:

    > I'd like to get some .net sample code that shows me how to make a
    > complete
    > backup of a hard drive (like my C: drive) to another location (say my D:
    > drive) while the C: drive is in use.
    No doubt there's lots of different approaches to something like this.
    However, assuming you're just going to do a simple file-by-file transfer,
    you might want to look at the classes in System.IO, including File and
    Directory. Those support operations like enumerating the files and
    directories in the file system, and copying a file from one place to
    another.

    Your stipulation of "while the drive is in use" complicates things,
    because of the possibility that a file may be in use and thus not able to
    be copied. One approach to dealing with that is to maintain a list of
    files that you come across like that, and try them again later. To some
    extent it's an unresolvable problem, so I'm not sure it'd be worthwhile to
    do anything more complicated than that. In fact, you may simply just want
    to report to the user and leave it at that.

    If you are intending to archive files into a single large file, then you
    may also want to look at classes like FileStream and GZipStream (the
    latter for making an attempt to compress the input...if you have a lot of
    compressible files, like HTML, XML, etc. then this optional feature might
    be worth looking into).

    No need to give credit, IMHO. The newsgroup is available for all, with
    advice given freely. By asking a question here, you help others as much
    as yourself, as someone else may later come looking for the answer to the
    same question. A person would have to invest a lot more effort than just
    answering a quick question in the newsgroup to warrant being credited in
    some specific software. Otherwise, by that metric I suspect that a number
    of us are being left out being credited for helping with a fairly broad
    selection of programs (there are at least a dozen people who regularly
    answer non-trivial questions here, and probably another dozen or two who
    do so infrequently, and as far as I know, none of us are ever explicitly
    credited in whatever final product was being developed).

    Pete

      My System SpecsSystem Spec

  3. #3


    Cor Ligthert[MVP] Guest

    Re: Need example of backing up disk....

    Jim,

    I don't think that any version of VB is the right programma language, as in
    fact not any managed language.

    Maybe raw C can help you or otherwise Intel Assembler.

    Just my opinion,

    Cor

    "jim" <jim@xxxxxx> schreef in bericht
    newscnZj.13921$hv2.973@xxxxxx

    > I'd like to get some .net sample code that shows me how to make a complete
    > backup of a hard drive (like my C: drive) to another location (say my D:
    > drive) while the C: drive is in use.
    >
    > Basically, I'd like to make and give away free backup software because
    > Acronis has given me so many problems.
    >
    > Any help or links you could provide would be greatly appreciated. (Please
    > include your name to be added to the credits screen in the free
    > application.)
    >
    > jim
    >

      My System SpecsSystem Spec

  4. #4


    Smokey Grindel Guest

    Re: Need example of backing up disk....

    So you want to make software that you do not know how to make to be better
    then Acronis which is actually relatively stable? im so lost on your logic..

    "jim" <jim@xxxxxx> wrote in message
    newscnZj.13921$hv2.973@xxxxxx

    > I'd like to get some .net sample code that shows me how to make a complete
    > backup of a hard drive (like my C: drive) to another location (say my D:
    > drive) while the C: drive is in use.
    >
    > Basically, I'd like to make and give away free backup software because
    > Acronis has given me so many problems.
    >
    > Any help or links you could provide would be greatly appreciated. (Please
    > include your name to be added to the credits screen in the free
    > application.)
    >
    > jim
    >


      My System SpecsSystem Spec

  5. #5


    Ben white Guest

    Re: Need example of backing up disk....

    "Cor Ligthert[MVP]" wrote:

    > Jim,
    >
    > I don't think that any version of VB is the right programma language, as in
    > fact not any managed language.
    >
    > Maybe raw C can help you or otherwise Intel Assembler.
    >
    > Just my opinion,
    >
    > Cor
    Cor -
    IMHO the appropriate language is the language the programmer choses to
    do the application in. VB isn't inherently wrong and C isn't
    inherently right. Yes he wants to back things up [IO intensive and
    Richter puts that whole issue to bed, along with the simple sense of
    how the different paradigms get executed] but I doubt that is the only
    requirement. Right language is decided in the totality of the design
    and in consideration of all the requirements. (His first stated
    requirement is vengeance - that is a language agnostic goal) There
    were C neanderthals who said I couldn't do a "real-time" app in VB.
    Done, delivered and still being used by a major manufacturing
    organization to handle toxic chemicals. Once the definitions were
    understood it met and exceeded all requirements. Cutting to the
    chase, language snobbery doesn't elevate the art of programming which
    is how I see these forums. Answering the question as Peter did does.

    >
    > "jim" <j...@xxxxxx> schreef in berichtnewscnZj.13921$hv2.973@xxxxxx
    >

    > > I'd like to get some .net sample code that shows me how to make a complete
    > > backup of a hard drive (like my C: drive) to another location (say my D:
    > > drive) while the C: drive is in use.
    >

    > > Basically, I'd like to make and give away free backup software because
    > > Acronis has given me so many problems.
    >

    > > Any help or links you could provide would be greatly appreciated. (Please
    > > include your name to be added to the credits screen in the free
    > > application.)
    >

    > > jim
    Jim -

    I recently finished a utlity that handles backing up things in a very
    simplistic manner as you seem to be asking. I did it using the
    facilities Peter described, I also took a couple of ideas from another
    Site (Code Project) and use a pie chart as a progress bar just for
    giggles. Motivation is good but have some fun along the way.

      My System SpecsSystem Spec

  6. #6


    Cor Ligthert[MVP] Guest

    Re: Need example of backing up disk....

    Ben,

    This has nothing to do with preference, as you want to make a complete
    immage of a drive, despite of all security options, despite of what is
    happening in that time, then you have to use software that is not running on
    the OS level.

    Just my opinion.

    Cor

    "Ben white" <pgwichtendahl@xxxxxx> schreef in bericht
    news:935bde15-78cd-455a-b9b8-344d76108105@xxxxxx

    > "Cor Ligthert[MVP]" wrote:

    >> Jim,
    >>
    >> I don't think that any version of VB is the right programma language, as
    >> in
    >> fact not any managed language.
    >>
    >> Maybe raw C can help you or otherwise Intel Assembler.
    >>
    >> Just my opinion,
    >>
    >> Cor
    > Cor -
    > IMHO the appropriate language is the language the programmer choses to
    > do the application in. VB isn't inherently wrong and C isn't
    > inherently right. Yes he wants to back things up [IO intensive and
    > Richter puts that whole issue to bed, along with the simple sense of
    > how the different paradigms get executed] but I doubt that is the only
    > requirement. Right language is decided in the totality of the design
    > and in consideration of all the requirements. (His first stated
    > requirement is vengeance - that is a language agnostic goal) There
    > were C neanderthals who said I couldn't do a "real-time" app in VB.
    > Done, delivered and still being used by a major manufacturing
    > organization to handle toxic chemicals. Once the definitions were
    > understood it met and exceeded all requirements. Cutting to the
    > chase, language snobbery doesn't elevate the art of programming which
    > is how I see these forums. Answering the question as Peter did does.
    >

    >>
    >> "jim" <j...@xxxxxx> schreef in
    >> berichtnewscnZj.13921$hv2.973@xxxxxx
    >>

    >> > I'd like to get some .net sample code that shows me how to make a
    >> > complete
    >> > backup of a hard drive (like my C: drive) to another location (say my
    >> > D:
    >> > drive) while the C: drive is in use.
    >>

    >> > Basically, I'd like to make and give away free backup software because
    >> > Acronis has given me so many problems.
    >>

    >> > Any help or links you could provide would be greatly appreciated.
    >> > (Please
    >> > include your name to be added to the credits screen in the free
    >> > application.)
    >>

    >> > jim
    >
    > Jim -
    >
    > I recently finished a utlity that handles backing up things in a very
    > simplistic manner as you seem to be asking. I did it using the
    > facilities Peter described, I also took a couple of ideas from another
    > Site (Code Project) and use a pie chart as a progress bar just for
    > giggles. Motivation is good but have some fun along the way.

      My System SpecsSystem Spec

  7. #7


    jim Guest

    Re: Need example of backing up disk....

    Admitting that I \have never written backup software, I have written many
    hundreds of applications in VB, VB.Net and some older languages like Turbo
    Pascal.

    In asking for the source code, I was hoping to accomplish 2 main things.
    (1) To learn more about a process than I currently know and (2) get a head
    start on the project.

    As for you r ability to follow the logic therein.....well, you can do what
    you can do.

    jim

    "Smokey Grindel" <nospam@xxxxxx> wrote in message
    news:uMXSk2OvIHA.1504@xxxxxx

    > So you want to make software that you do not know how to make to be better
    > then Acronis which is actually relatively stable? im so lost on your
    > logic..
    >
    > "jim" <jim@xxxxxx> wrote in message
    > newscnZj.13921$hv2.973@xxxxxx

    >> I'd like to get some .net sample code that shows me how to make a
    >> complete backup of a hard drive (like my C: drive) to another location
    >> (say my D: drive) while the C: drive is in use.
    >>
    >> Basically, I'd like to make and give away free backup software because
    >> Acronis has given me so many problems.
    >>
    >> Any help or links you could provide would be greatly appreciated.
    >> (Please include your name to be added to the credits screen in the free
    >> application.)
    >>
    >> jim
    >>
    >
    >


      My System SpecsSystem Spec

  8. #8


    Ben white Guest

    Re: Need example of backing up disk....

    Hate to see a person without help when they ask. Can you give me some
    idea of where you are and where your "blind spots" are?


      My System SpecsSystem Spec

  9. #9


    jim Guest

    Re: Need example of backing up disk....


    "Ben white" <pgwichtendahl@xxxxxx> wrote in message
    news:3e278080-9292-42f6-a398-374cd8147fbf@xxxxxx

    > Hate to see a person without help when they ask. Can you give me some
    > idea of where you are and where your "blind spots" are?
    I am wondering how to back up in-use files. I am currently looking into
    using Windows Shadow Copy service - but that will only work if it is
    installed and endabled. Perhaps there is a way for me to install or enable
    it if it is not enabled.....still looking.

    Thanks!



      My System SpecsSystem Spec

  10. #10


    kimiraikkonen Guest

    Re: Need example of backing up disk....

    On May 29, 1:58 am, "jim" <j...@xxxxxx> wrote:

    > "Ben white" <pgwichtend...@xxxxxx> wrote in message
    >
    > news:3e278080-9292-42f6-a398-374cd8147fbf@xxxxxx
    >

    > > Hate to see a person without help when they ask. Can you give me some
    > > idea of where you are and where your "blind spots" are?
    >
    > I am wondering how to back up in-use files. I am currently looking into
    > using Windows Shadow Copy service - but that will only work if it is
    > installed and endabled. Perhaps there is a way for me to install or enable
    > it if it is not enabled.....still looking.
    >
    > Thanks!
    Jim,
    If your intention is to programme through Volume Shadow Copy Service,
    you shouldn't worry about the service's running status, you can
    start / stop or query status using servicecontroller component in your
    toolbox:

    ' Check status and start if service is not running:
    ' First set ServiceName property to "VSS"
    ' srvcontroller is your component name here
    If Not srvcontroller.Status =
    ServiceProcess.ServiceControllerStatus.Running Then
    srvcontroller.Start()
    End If

    Hope this makes sense,

    Onur Güzel



      My System SpecsSystem Spec

Need example of backing up disk....

Similar Threads
Thread Thread Starter Forum Replies Last Post
Backing up the hard disk? jldewooley Software 3 12 Dec 2008
backing up before xp3 Wasted Virtual PC 6 15 Oct 2008
Backing up WLM Anthoncon Live Mail 13 27 Jan 2008
Backing up on a CD-RW Compact Disk Rewritable AJ Business Services Vista file management 2 26 Jan 2008
Backing up Vista and XP to the same disk mike843536 Vista file management 1 23 Sep 2007