Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

xcopy don't do it for me.

  • 24-04-2001 08:30PM
    #1
    Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭


    Here's the deal.

    I have File \dir1\dir2\dir3\dir4\filename.txt

    I want to copy this to dir5 but maintain the same directory structure underneath.

    From what I gather XCopy won't do this (forget about copy). I can get it to generate a path copy but then it goes and copies everything else too.

    The workaround I have is to set the ATTRIB of all the files to -A, then set the ATTRIB of only the files I want to copy to +A then I use XCopy and specify the root to copy and only copy with +A set on files.

    Works but is messy. Is there a proggy which will do this for me? Or do I have to write my own?


Comments

  • Registered Users, Registered Users 2 Posts: 20,099 ✭✭✭✭WhiteWashMan


    write your own and sell it for millions, coz people really want to copy one file in 5 cascading empty directories smile.gif


  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    tongue.gif

    well that was just an example. Actually I have 400-500 files in various different subdirectories out of 2000+ that I want to copy, so a proggy to do it would be handy as the attrib method is a bit slow.



  • Registered Users, Registered Users 2 Posts: 20,099 ✭✭✭✭WhiteWashMan


    to be honest id just create the directories and copy and paste.
    or you might be able to use something like winzip to keep the directories structure?


  • Closed Accounts Posts: 1,193 ✭✭✭Kix


    Hobbes, do you have a c compiler? I'll send you some source I wrote which pretty much does this job. There's a few things hard coded into it - like the file extensions to copy - but it should be a piece of pi$$ for you to alter. Just let me know and I'll mail it to you.

    I should also mention that the code uses the Win SDK - does this suit?

    [This message has been edited by Kix (edited 25-04-2001).]


  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    I already wrote the proggy. Thanks anyway. Takes a filelist from a file and copys only those files.



  • Advertisement
  • Registered Users, Registered Users 2 Posts: 326 ✭✭ConUladh


    Bit of a late resonse but

    Check out this extract from the langalist, only had a quick look but might do what you want (even though you've already done it)

    7) Free XXcopy

    I've previously mentioned the DOS command, Xcopy--- and the freeware DOS
    extension XXcopy (see http://www.langa.com/newsletters/2000/2000-06-
    15.htm#5 ) Basically, Xcopy is a more powerful "copy" command that can
    move entire directory trees in your hard drive all at once. XXcopy is
    even more powerful, with more built-in features.

    If you're a power user, the free XXcopy can be a very handy tool. The
    current version is 2.44.4; if you're using an older version or are new
    to this powerful utility, check out:

    ]http://www.xxcopy.com/xxcopy/index.html


    [This message has been edited by ConUladh (edited 30-04-2001).]


Advertisement