Results 1 to 13 of 13
  1. #1
    3 Star Lounger
    Join Date
    Dec 2009
    Location
    Ohio, USA
    Posts
    227
    Thanks
    0
    Thanked 0 Times in 0 Posts

    New Backup Project (AutoItv3 Script)

    I'm creating a script in AutoIt to use some of the software on my computer to create a new method for backups. I'll be doing research off and on to find solutions to these questions but I still want to post here in case someone else either beats me to the answer or finds a solution before me. So, I'm just going to list what I'm looking for:

    A command to save a configuration file from COMODO filewall. I use the Proactive security mode and am looking for the proper command (not just to copy the appdata folder as I'll be doing that anyways and it's not as versatile).
    I'm still looking into this.


    A command or script to save all of my iTunes Playlist. I manage multiple computers and we all share music (I rip all CD's on my computer, copy them to my External, then copy that to other computers so everyone has access to all of our collective music in my house).
    Got enough data, I'll open iTunes, activate the window (which also waits for the window to be active), press a series of keys to export my library.


    A command or script to copy files using the current system default (I want to use SuperCopier2 to copy the files because of some of it's abilities and settings, the settings are already set up).
    Since I can't get it to work with SuperCopier directly I'm going to work through Windows Explorer and make my script copy normally (I was hoping for a more direct method but this will have to do).


    A command to save the output of a tree (I believe the term is piping the output to a file but I've not any real experience with this). (To clarify by tree I mean the tree command that list all files and directories under the source).
    Still looking for this.

    A command to convert that file (or rather files) for use in the next step. Essentially I need a quick and guaranteed way to rename each line in the file. (more below)

    A way to compare two text files and create a file with everything in one that's not in the other.

    A command (or rather script) to delete files that are in a list in a text file.

    The last three parts the idea is that I'll compare a tree listing of my local folders compared to the backup folders and if anything resides on the backup that's not on the local copy I'll delete it. This accounts for files that were renamed or deleted (shouldn't be too many renames so I'm not to worried about the extra tax on my hardware)

    For the last part if anyone knows of a way to simply rename files that were renamed (other than using SyncToy as that's my current solution and it seems to be missing the ability to use shadow copies, as far as I know SuperCopier2 is fine with using shadow copies) it would be much appreciated. (I'll still have to do the last part or something like it to deal with deleted files and I want to have a file containing a tree of my drive in case something ever happens like it did recently and I lost my backup drive (plus all the other stuff I keep on there and no where else due to space restrictions).
    Last edited by grnorris; 2011-05-02 at 13:30. Reason: Added what I've done thus far
    Current Machine:HP Compaq 6910p with 4GB RAM, Core2Duo @ 2.20 GHz, Mobile Intel 965 Express Chipset Family, Avast free, Malwarebyte's free, TP-Link wireless card (as the built in card has nothing but problems with empty solutions): The card identifies as "Atheros AR922X Wireless Network Adapter". [Not the best machine but it does internet, docs, and vids, and some games (PvZ, Spore)]

  2. #2
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,199
    Thanks
    48
    Thanked 987 Times in 917 Posts
    This is a nice juicy project for you, but I don't think AutoIt is the right tool. I would be writing this in VB script as it can do all the things you require, except saving the config file in Comodo or the playlists.
    There are plenty of people on the net who can help with VBS.

    cheers, Paul

  3. #3
    3 Star Lounger
    Join Date
    Dec 2009
    Location
    Ohio, USA
    Posts
    227
    Thanks
    0
    Thanked 0 Times in 0 Posts
    @Paul:
    I probably could do this with VBS but I'm far more familiar with AutoIt and I have an easy way to launch AutoIt as well (I have it in my Jump bar so I just right click and select a pinned script). I've been slowly working on finding info for this and thus far I've found only that there is no command line function for SuperCopier 2 and there isn't likely to be any soon. As such I've posted on the AutoIt forums (which I'll probably post some more to in the near future) in hopes someone will be able to give me a GUI code to do the trick (AutoIt can select things based on Window titles so there should be some way to do it).
    Current Machine:HP Compaq 6910p with 4GB RAM, Core2Duo @ 2.20 GHz, Mobile Intel 965 Express Chipset Family, Avast free, Malwarebyte's free, TP-Link wireless card (as the built in card has nothing but problems with empty solutions): The card identifies as "Atheros AR922X Wireless Network Adapter". [Not the best machine but it does internet, docs, and vids, and some games (PvZ, Spore)]

  4. #4
    3 Star Lounger
    Join Date
    Dec 2009
    Location
    Ohio, USA
    Posts
    227
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've made some progress with this. I'll edit the first post with the details.

    Edit: OP has been modified, what I'm looking for now (other than the Comodo thing) is a command to create and save a tree to a certain location (I think piping is used for this purpose but I don't really know how to do that).
    Last edited by grnorris; 2011-05-02 at 13:32.
    Current Machine:HP Compaq 6910p with 4GB RAM, Core2Duo @ 2.20 GHz, Mobile Intel 965 Express Chipset Family, Avast free, Malwarebyte's free, TP-Link wireless card (as the built in card has nothing but problems with empty solutions): The card identifies as "Atheros AR922X Wireless Network Adapter". [Not the best machine but it does internet, docs, and vids, and some games (PvZ, Spore)]

  5. #5
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    What you want is:

    TREE [drive:][path] [/F] [/A] > [drive:][path]filename.ext

    Switches:
    /F Display the names of the files in each folder
    /A Use ASCII instead of extended characters
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  6. #6
    3 Star Lounger
    Join Date
    Dec 2009
    Location
    Ohio, USA
    Posts
    227
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks, Now I need to convert this to a format that includes the full file path of each file (for example: "C:\Program Files\CCleaner\CCleaner.exe"). With or without quotes (I should be able to remove the quotes if need be quite easily). Once I have that I'll need to convert from there to a format replaces C:\ or B:\ with the relative backup location then I'll need to compare the tree's of the actual locations to the backup locations (By replacing the C:\ and B:\ I'll be making the local trees reflect their backup locations. This way I can just say to delete any entries that already exist then keep what remains as a list of files to delete (Files that don't exist on the original and thus don't need to exist on the backup). So it's clear this is meant to only keep a single relative backup, not to keep multiple backups of each drive.

    Quote Originally Posted by RetiredGeek View Post
    What you want is:

    TREE [drive:][path] [/F] [/A] > [drive:][path]filename.ext

    Switches:
    /F Display the names of the files in each folder
    /A Use ASCII instead of extended characters
    Current Machine:HP Compaq 6910p with 4GB RAM, Core2Duo @ 2.20 GHz, Mobile Intel 965 Express Chipset Family, Avast free, Malwarebyte's free, TP-Link wireless card (as the built in card has nothing but problems with empty solutions): The card identifies as "Atheros AR922X Wireless Network Adapter". [Not the best machine but it does internet, docs, and vids, and some games (PvZ, Spore)]

  7. #7
    3 Star Lounger
    Join Date
    Dec 2009
    Location
    Ohio, USA
    Posts
    227
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've done some research and found that instead of Tree "dir [drive] /b /s > [location]" actually works a bit better (it already puts the files in the proper list format) but, I've found a problem with this approach. When listing the files it will repeatedly open the shortcut for "Application Data" which is somewhat recursive as it brings you back to the same folder except Windows detects it as "C:\Users\Greg\Application Data" thus when dir tries to follow the link it will eventually get "C:\Users\Greg\Application Data\Application Data\Application Data\Application Data\Application Data" until it's too much for it to handle and it quits. Obviously this prevents me from getting a clean list and from spotting any other potential issues. I'm betting the same thing probably happened in tree but I just didn't notice it. The exact error is (without showing the actual path): "The directory name [drive:\path] is too long."

    I've already tried to ignore recursive's but it apparently isn't a recursive so that didn't work.

    I'm going to continue looking for a fix but would be happy enough if someone else beat me to it.
    Current Machine:HP Compaq 6910p with 4GB RAM, Core2Duo @ 2.20 GHz, Mobile Intel 965 Express Chipset Family, Avast free, Malwarebyte's free, TP-Link wireless card (as the built in card has nothing but problems with empty solutions): The card identifies as "Atheros AR922X Wireless Network Adapter". [Not the best machine but it does internet, docs, and vids, and some games (PvZ, Spore)]

  8. #8
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    dir [drive] /b /s > [location]
    I tried this and it worked flawlessly! I listed my G: drive to my V: drive

    Did you by any chance have [location] somewhere within the currently active folder, e.g. [drive]?
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  9. #9
    3 Star Lounger
    Join Date
    Dec 2009
    Location
    Ohio, USA
    Posts
    227
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by RetiredGeek View Post
    I tried this and it worked flawlessly! I listed my G: drive to my V: drive

    Did you by any chance have [location] somewhere within the currently active folder, e.g. [drive]?
    Since this is a backup project I need to make a list of my entire C: drive. An example error:

    The directory name C:\Documents and Settings\All Users\Application Data\Application Data\Application Data\Application Data\Application Data\Application Data\Application Data\Application Data\Microsoft\Windows\Start Menu\Programs\Microsoft Visual Studio 2010\Microsoft Windows SDK Tools is too long.

    As you can see it follows "Application Data" a shortcut that leads back to the same folder (don't know why but apparently this is needed for Windows to work correctly) until the name is too long for even the largest buffers (which I set my buffer to the max size).
    Current Machine:HP Compaq 6910p with 4GB RAM, Core2Duo @ 2.20 GHz, Mobile Intel 965 Express Chipset Family, Avast free, Malwarebyte's free, TP-Link wireless card (as the built in card has nothing but problems with empty solutions): The card identifies as "Atheros AR922X Wireless Network Adapter". [Not the best machine but it does internet, docs, and vids, and some games (PvZ, Spore)]

  10. #10
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    You may have a problem with your file structure.
    I tried it on my entire C:\ drive again w/o problem. See below.
    Attached Images Attached Images
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  11. #11
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Quote Originally Posted by grnorris View Post
    I've already tried to ignore recursive's but it apparently isn't a recursive so that didn't work.
    If you open cmd and navigate into your C:\Users\Greg folder, it appears you can select or exclude the magic pointers using the "L" attribute.

    Code:
    dir /aL
    
    dir /a-L
    I don't know whether AutoIt uses the same parameters.

  12. #12
    3 Star Lounger
    Join Date
    Dec 2009
    Location
    Ohio, USA
    Posts
    227
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've confirmed using your addition that it's not a recursive file. I still get the same error and results in the end file like: "C:\Documents and Settings\All Users\Application Data\Application Data\Adobe" My command (in a command line) was: dir C:\ /a-L /b /s > "C:\Users\Greg\Local Backups\ListC.txt"

    If I could ignore shortcut files (or ignore the extension .lnk) then I could avoid this issue but there doesn't appear to be an option for this.

    The 'folder' "C:\Documents and Settings\All Users\Application Data\" is actually a shortcut back to "C:\Documents and Settings\All Users" so it just loops continuously. Also since it's obviously following this shortcut that also means that any other shortcuts to folders will be followed.

    I'll include a couple text files in my next post that may help.

    @RetiredGeek
    I'm not sure why your code works and mine doesn't. You did type the same thing I did.

    Again I'm referring to a command line code. The AutoIt script will just execute it like a batch file would.

    Quote Originally Posted by jscher2000 View Post
    If you open cmd and navigate into your C:\Users\Greg folder, it appears you can select or exclude the magic pointers using the "L" attribute.

    Code:
    dir /aL
    
    dir /a-L
    I don't know whether AutoIt uses the same parameters.
    Current Machine:HP Compaq 6910p with 4GB RAM, Core2Duo @ 2.20 GHz, Mobile Intel 965 Express Chipset Family, Avast free, Malwarebyte's free, TP-Link wireless card (as the built in card has nothing but problems with empty solutions): The card identifies as "Atheros AR922X Wireless Network Adapter". [Not the best machine but it does internet, docs, and vids, and some games (PvZ, Spore)]

  13. #13
    3 Star Lounger
    Join Date
    Dec 2009
    Location
    Ohio, USA
    Posts
    227
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The files attached are the output from the command line (hence the name) and part of the outputted ListC.txt (the full file is far to large to upload and the only method I know of to split it up would be RAR compression which doesn't appear to be accepted.
    Attached Files Attached Files
    Current Machine:HP Compaq 6910p with 4GB RAM, Core2Duo @ 2.20 GHz, Mobile Intel 965 Express Chipset Family, Avast free, Malwarebyte's free, TP-Link wireless card (as the built in card has nothing but problems with empty solutions): The card identifies as "Atheros AR922X Wireless Network Adapter". [Not the best machine but it does internet, docs, and vids, and some games (PvZ, Spore)]

Posting Permissions

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