+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 22
Windows Thread, End of term copy files! in Technical; Hi all, I'm back with the same question as last year hopefully some software has been found that can do ...
  1. #1

    Join Date
    Jun 2009
    Posts
    57
    Thank Post
    22
    Thanked 1 Time in 1 Post
    Rep Power
    0

    End of term copy files!

    Hi all,

    I'm back with the same question as last year hopefully some software has been found that can do it!

    What I'm wanting to do is copy all the Year 11 & 13 student's contents to a Buffalo box. But there's a catch! I've got to leave the root folder behind and delete all of it's contents when transferring? For the past 6 year's we've done this by hand 1 at a time & as you can tell - it's a pain in the a-s-s!

    Can anyone save me?

    Cheers

  2. #2
    kearton's Avatar
    Join Date
    May 2007
    Location
    Yorkshire, via NZ ;)
    Posts
    887
    Thank Post
    175
    Thanked 113 Times in 91 Posts
    Rep Power
    48
    How about using Robocopy with a /move option?

  3. #3

    Join Date
    Jun 2009
    Posts
    57
    Thank Post
    22
    Thanked 1 Time in 1 Post
    Rep Power
    0
    I looked at Robocopy last year but how would I make it keep the top folder? e.g.

    \\hosea\d$\users\students\Joe.Bloggs - Just copies file's & leaves an empty Joe.Blogg's folder.

    to

    \\Server2\userbackup\Year11\Joe.Bloggs

  4. #4
    Admiral208's Avatar
    Join Date
    Mar 2008
    Location
    Bridgwater
    Posts
    720
    Thank Post
    176
    Thanked 63 Times in 55 Posts
    Rep Power
    40
    Would it be quicker to move them and then recreate the folders?

  5. #5

    Join Date
    Jun 2009
    Posts
    57
    Thank Post
    22
    Thanked 1 Time in 1 Post
    Rep Power
    0
    I suggested this but it would mess up AD folder settings as if the kid's come back they won't have a home area.

  6. #6

    nephilim's Avatar
    Join Date
    Nov 2008
    Location
    Dunstable
    Posts
    12,264
    Thank Post
    1,670
    Thanked 2,016 Times in 1,465 Posts
    Blog Entries
    2
    Rep Power
    451
    Copy out all of the contents to the new area
    Use a batch script to recreate the root folders

  7. #7

    Join Date
    Jun 2009
    Posts
    57
    Thank Post
    22
    Thanked 1 Time in 1 Post
    Rep Power
    0
    How would I go about keeping the folder settings within AD?

    Cheers

  8. #8
    Admiral208's Avatar
    Join Date
    Mar 2008
    Location
    Bridgwater
    Posts
    720
    Thank Post
    176
    Thanked 63 Times in 55 Posts
    Rep Power
    40
    As long as you keep the same folder names, it shouldn't be a problem.

  9. #9

    Join Date
    Jun 2009
    Posts
    57
    Thank Post
    22
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Do any of you have experience with the Robocopy option?

  10. #10
    36Degrees's Avatar
    Join Date
    Jan 2010
    Location
    Nottingham
    Posts
    1,065
    Thank Post
    165
    Thanked 153 Times in 124 Posts
    Rep Power
    52
    I'd try this -

    1) Export a list of usernames from AD to a text file

    2) Write a script which:
    a) maps drive Y: to \\hosea\d$\users\students\
    b) maps drive Z: to \\Server2\userbackup\Year11\
    c) Reads in username from text file
    d) Creates new folder Z:\username
    e) Robocopy Y:\username to Z:\username such that it moves the data

  11. #11
    Admiral208's Avatar
    Join Date
    Mar 2008
    Location
    Bridgwater
    Posts
    720
    Thank Post
    176
    Thanked 63 Times in 55 Posts
    Rep Power
    40
    thinking ahead for next time, I would create a folder called Files, or Work or similar inside each of the students folders that they can use to save work then all you would need to do is copy the entire folder structure to your backup then do a search for folders called work and delete them, therefore keeping the root folder of the student intact.

    i.e create \\hosea\d$\users\students\%username%\Files

    In AD alter the location of the the home drive to this new folder and it wont look any different to the students.

  12. #12


    Join Date
    Sep 2007
    Location
    UK
    Posts
    5,463
    Thank Post
    1,462
    Thanked 892 Times in 573 Posts
    Rep Power
    647
    This may be a daft way to do it but I map each year group folder and then do a search of all files on that mapped drive. I can then sort and block copy/delete. It's the only way I have found to deal with long files names.

  13. #13

    Join Date
    Jun 2009
    Posts
    57
    Thank Post
    22
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Sorry the reason we can't delete the root folder is because we want to keep the permissions on said folder.

  14. #14

    Join Date
    Jun 2009
    Posts
    57
    Thank Post
    22
    Thanked 1 Time in 1 Post
    Rep Power
    0
    What do people think to....

    Using a script to copy a list of the student's names taken from AD to xfer files from A to B.

    Then is there a way I can use Robocopy to delete the content's of multiple folders but leave the main header folder?

    e.g. Leave Joe.Blogg but remove all of it's contents?

  15. #15
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    4,993
    Thank Post
    120
    Thanked 286 Times in 263 Posts
    Rep Power
    107
    This could be a fairly simple script and as such I have put something together for you. It only currently looks at your folders and echos the robocopy command it would use. It only needs one more line of code to be live.
    Use this at your own risk!
    You need to decide what robocopy options you need as I just guessed so try on one student folder first by using robocopy at the cmd line.
    Please run it from the command line for testing eg
    Code:
    cscript movefiles.vbs
    unless you like pressing ok on a dialogue box for the number of student folders you have.

    Save this code into a folder called movefiles.vbs (or whatever you like)
    Code:
    Set FSO = CreateObject("Scripting.FileSystemObject")
    
    Const ORIGINAL_ROOT = "D:\Test" ' Source folder
    Const DEST_ROOT = "D:\Test2" ' Destination folder
    Set objFolder = FSO.GetFolder(ORIGINAL_ROOT)
    Set objShell = CreateObject("WScript.Shell")
    strCmdLine = ""
    
    Const ROBO_OPTIONS = "/e /zb /copyall /r:3 /w:15 /MOVE" ' Change these robocopy switches to what you want
    
    
        For Each Subfolder in objFolder.SubFolders
            Wscript.Echo "Currently looking at: " & Subfolder.Path & VbCrLf ' For testing to show which folder 
    		strCmdLine = "Robocopy " & Subfolder.Path & "\*.* " & DEST_ROOT & "\" & subfolder.name & " " & ROBO_OPTIONS ' to build the cmd line that will run
    		Wscript.echo strCmdLine ' to show the cmd line that will run
    		
            'ShowSubFolders Subfolder
        Next
    Let me know how you get on and I will help you finish it if you want to use it.
    Last edited by ChrisH; 3rd August 2011 at 11:50 AM. Reason: Code mistake

  16. 3 Thanks to ChrisH:

    Haux (3rd August 2011), nephilim (3rd August 2011), Oaktech (3rd August 2011)

SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. It must be the end of term because....
    By witch in forum General Chat
    Replies: 23
    Last Post: 18th December 2009, 08:49 AM
  2. ICT engineer in London (from now until end of term)
    By SpecialAgent in forum Educational IT Jobs
    Replies: 2
    Last Post: 23rd November 2009, 10:23 AM
  3. It's oh so quiet! (End of Term)
    By SteveB_NI in forum General Chat
    Replies: 10
    Last Post: 29th June 2009, 09:53 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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