Results 1 to 9 of 9
  1. #1
    4 Star Lounger
    Join Date
    Apr 2001
    Posts
    482
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Making a clean backup of modified files (Word 2000 VBA)

    I regularly update some web help files in more than one location. I then have to zip what I have done and take it to the other computer and delete what is there and replace it. The thing is, call it parenoia, I like to back up all the files in the directory when even one of them has changed. So this is what I need.

    1. Find all files in a specific parent directory and all its subdirectories that have been modified today.

    2. Determine the parent folder of the file.

    3. Gather a complete list of the parent folders and so that there is only distinct entries. For example:

    If the following files were modified:

    c:dir1dir2sub1file1.htm
    c:dir1dir2sub1file2.htm
    c:dir1dir2file3.htm

    Then I want the list to of directories to backup to just have one entry of "c:dir1dir2"

    4. Then I'd like to either like to have those directories listed in a Windows or Find dialog box that can then be dragged into a winzip file, OR ideally it would be nice to pass these directories directly to winzip to zip.

    5. I'd like to be able to have a separate procedure that could take the list of directories listed in step 3 and then delete recursively those directories on the other machine.

    I know, I don't ask for much. <img src=/S/heavy.gif border=0 alt=heavy width=40 height=34> If some of you guys could point me in the right direction for each of these steps, I'd be happy to take it from there.

    Thanks!!
    Troy

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Making a clean backup of modified files (Word 2000 VBA)

    THat could be done via VBA, but a better solution might be to use a "good" backup program that allows backup to a file, or even copying of files.

    I've been looking into using Dantz Retrospect 6 on a computer I am planning on building.
    It seems to offer more intelligent handling of file backup.

    Take a look at http://www.dantz.com.

  3. #3
    4 Star Lounger
    Join Date
    Apr 2001
    Posts
    482
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Making a clean backup of modified files (Word 2000 VBA)

    Thanks for the suggestion!!

    However, I'd like the experience of learning how to do each of the things mentioned in my post. (It would also be cheaper).

    Thanks!!
    Troy

  4. #4
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Making a clean backup of modified files (Word 2000 VBA)

    You could achieve much of what you want by using the Winzip command line add-on from a .bat file. But this won't help you learn the things you want to either <img src=/S/sad.gif border=0 alt=sad width=15 height=15>

    StuartR

  5. #5
    4 Star Lounger
    Join Date
    Apr 2001
    Posts
    482
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Making a clean backup of modified files (Word 2000 VBA)

    <P ID="edit" class=small>(Edited by TroyWells on 04-May-03 14:36. )</P>Actually I would probalby need this for step 4 below and would still learn lots from figuring out 1-3, 5.

    EDIT:
    After downloading and installing the add in, do I need to set a reference to it in my project? If so , which dll(s) do I need to references?


    1. Find all files in a specific parent directory and all its subdirectories that have been modified today.

    2. Determine the parent folder of the file.

    3. Gather a complete list of the parent folders and so that there is only distinct entries. For example:

    If the following files were modified:

    c:dir1dir2sub1file1.htm
    c:dir1dir2sub1file2.htm
    c:dir1dir2file3.htm

    Then I want the list to of directories to backup to just have one entry of "c:dir1dir2"

    4. Then I'd like to either like to have those directories listed in a Windows or Find dialog box that can then be dragged into a winzip file, OR ideally it would be nice to pass these directories directly to winzip to zip.

    5. I'd like to be able to have a separate procedure that could take the list of directories listed in step 3 and then delete recursively those directories on the other machine.

    Thanks Stuart!!
    Troy

  6. #6
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Making a clean backup of modified files (Word 2000 VBA)

    When I said "from a bat file", I was expecting that you would use the Windows Scripting Host or similar to create a .BAT file to run the WinZip commands. I don't think it provides an API. I have come across a 3rd party ZIP product with an API, but that was when I was doing a project about 5 years ago and I don't remember the details anymore, maybe it was a version of PKZIP?

    StuartR

  7. #7
    4 Star Lounger
    Join Date
    Apr 2001
    Posts
    482
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Making a clean backup of modified files (Word 2000 VBA)

    Please forgive my ignorance, but what is the Windows Scripting Host and how do I use it?

    Also I still need help with steps 1, 2, 3, and 5 below.

    1. Find all files in a specific parent directory and all its subdirectories that have been modified today.

    2. Determine the parent folder of the file.

    3. Gather a complete list of the parent folders and so that there is only distinct entries. For example:

    If the following files were modified:

    c:dir1dir2sub1file1.htm
    c:dir1dir2sub1file2.htm
    c:dir1dir2file3.htm

    Then I want the list to of directories to backup to just have one entry of "c:dir1dir2"

    4. Then I'd like to either like to have those directories listed in a Windows or Find dialog box that can then be dragged into a winzip file, OR ideally it would be nice to pass these directories directly to winzip to zip.

    5. I'd like to be able to have a separate procedure that could take the list of directories listed in step 3 and then delete recursively those directories on the other machine.

    Thanks!!
    Troy

  8. #8
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Making a clean backup of modified files (Word 2000 VBA)

    You are working well outside my area of competence. A search on google for Windows Scripting Host may get you started.

    StuartR

  9. #9
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Making a clean backup of modified files (Word 2000 VBA)

    wscript.exe and cscript.exe

    If you've used the FileSystemObject, you've used the Windows script host.

    MS recently patched something related to scripting (security update), so you might want to check for the latest version at microsoft.com.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •